Wednesday, February 23, 2011

A refreshed $.ajax in jQuery 1.5

There has been a lot of discussion about changes in jQuery 1.5 related to $.ajax and friends; one that I’m particularly excited about is that the Ajax methods now return a jqXHR object, which has capabilities far beyond those of the native XHR that the Ajax methods returned prior to jQuery 1.5.
In this 10-minute screencast, I go over some of the changes that every jQuery developer needs to know about in order to make more productive use of the Ajax methods, including a new function signature for $.ajax, the ability to add callbacks to a request after the request is set up, the ability to add error callbacks to requests set up using convenience methods like $.get, and the new Promises/A-compliant behavior of the request object.

http://vimeo.com/20181732
http://blog.rebeccamurphey.com/a-refreshed-ajax-in-jquery-15

A Hand-Coded Designer CSS UI Kit



Web UI sets have been around for ages, but this takes things a step further. This free UI Kit is coded by hand using HTML5 and CSS3 so you can easily drop these elements into any project you’re working on. This code is made to take advantage of modern browsers and to degrade gracefully in older versions of internet explorer, so no matter what your client or visitor is using they will be see an excellent design.
Most major web elements are included—buttons, tables, headings, etc—and each of these is done in six color variations. Just pick the element you need, insert a few lines of CSS, and copy the HTML elements into your document. Full preview and instructions are below.

http://medialoot.com/blog/a-hand-coded-designer-css-ui-kit/

Tuesday, February 22, 2011

LogMe

Adds simple logging functionality for every class LogMe is registered with.
The standard behaviour cares about the naming of the logfile. In the example above the logfile can be found under YourApplication/log/post_ENVIRONMENT.log depending on the environment you’re currently working on.


https://github.com/icatcher-at/log_me
http://agilewebdevelopment.com/plugins/log_me
http://www.tonyamoyal.com/2009/09/24/specific-logging-for-your-rails-models-the-easy-way/

Hirb - Irb On The Good Stuff

Irb is a great place for interacting with Ruby. Unfortunately, even with the colorful help of wirble, it’s not so great for visualizing the output of those interactions. Hirb aims to change that.
Hirb provides a mini view framework for console applications, designed with irb in mind. Given the output of a console application, it applies a view if there is one to apply, based on the output’s class.

vestal_versions for Rails 3

acts_as_versioned by technoweenie was a great start, but it failed to keep up with ActiveRecord’s introduction of dirty objects in version 2.1. Additionally, each versioned model needs its own versions table that duplicates most of the original table’s columns. The versions table is then populated with records that often duplicate most of the original record’s attributes. All in all, not very DRY.
vestal_versions requires only one versions table (polymorphically associated with its parent models) and no changes whatsoever to existing tables. But it goes one step DRYer by storing a serialized hash of only the models’ changes. Think modern version control systems. By traversing the record of changes, the models can be reverted to any point in time.

Finding Unused CSS

Over time a CSS file can become large and filled with unused selectors. In this episode I show how to use the Deadweight gem to determine which CSS selects you can remove.


http://railscasts.com/episodes/180-finding-unused-css

Wednesday, February 16, 2011

CSS drop-shadows without images

Drop-shadows are easy enough to create using pseudo-elements. It’s a nice and robust way to progressively enhance a design. This post is a summary of the technique and some of the possible appearances.
Demo: CSS drop-shadows without images
Known browser support: Firefox 3.5+, Chrome 5+, Safari 5+, Opera 10.6+

http://nicolasgallagher.com/css-drop-shadows-without-images/

JavaScript Cache Provider

Every developer knows the importance of caching. From end to end you have caching on the backend (memcached, xcache, etc.) to prevent your databases being lit on fire, edge caching on content delivery networks (CDN’s) in hopes that your browser will cache assets it sees more than once. And of course client-side caching so you don’t repeat expensive operations (albeit algorithmically or high volume repitions). Here is a solution in JavaScript to help you out with the latter, with optional support for HTML5 Local Storage.

http://www.dustindiaz.com/javascript-cache-provider/

Tuesday, February 15, 2011

((( Racket )))

  1. Grow your Program
    Racket's interactive mode encourages experimentation, and quick scripts easily compose into larger systems. Small scripts and large systems both benefit from native-code JIT compilation. When a system gets too big to keep in your head, you can add static types.
  2. Grow your Language
    Extend Racket
    whenever you need to. Mold it to better suit your tasks without sacrificing interoperability with existing libraries and without having to modify the tool chain. When less is more, you can remove parts of a language or start over and build a new one.
  3.  Grow your Skills
    Whether you're just starting out, want to know more about programming language applications or models, looking to expand your horizons, or ready to dive into research, Racket can help you become a better programmer and system builder.
 http://racket-lang.org/

Monday, February 14, 2011

Indexing SQL LIKE Filters

The SQL LIKE operator is a common cause of performance issues because the performance is vastly depending on the search term. But it's not the selectivity of the entire search term that determines the performance—it's the prefix selectivity that matters. In that context, the prefix is the substring before the first wildcard.

http://use-the-index-luke.com/sql/where-clause/searching-for-ranges/like-performance-tuning

Sunday, February 13, 2011

Isotope

  1. An exquisite jQuery plugin for magical layouts
  2. Reveal & hide items with filtering
  3. Re–order items with sorting
  4. Dynamic, intelligent layouts
  5. Captivating animations
  6. Sort items by just about anything
  7. Powerful methods, simple syntax
  8. Progressively enhanced for CSS3 transforms & transitions
http://isotope.metafizzy.co/

jQuery Splatter Plugin

Splatter is a jQuery plugin which applies a random position, size, and color to elements on a page. The most basic implementation adds randomly colored and positioned asterisks to the element:
simple_example
To see some working examples, check out the demo page.

http://coryschires.com/jquery-splatter-plugin/

The Difference Between jQuery’s .bind(), .live(), and .delegate()

The difference between .bind(), .live(), and .delegate() is not always apparent. Having a clear understanding of all the differences, though, will help us write more concise code and prevent bugs from popping up in our interactive applications.

.bind()


$('a').bind('click', function() { alert("That tickles!") });
This is the most straight forward binding method. jQuery scans the document for all $('a') elements and binds the alert function to each of their click events.

.live()


$('a').live('click', function() { alert("That tickles!") });
jQuery binds the alert function to the $(document) element, along with 'click' and 'a' as parameters. Any time an event bubbles up to the document node, it checks to see if the event was a click and if the target element of that event matches the 'a' CSS selector. If both are true, the function executes.
The live method can also be bound to a specific element (or “context”) other than document, like this:

$('a', $('#container')[0]).live(...);

.delegate()


$('#container').delegate('a', 'click', function() { alert("That tickles!") });
jQuery scans the document for $('#container'), and binds the alert function along with the click event and 'a' CSS selector as parameters. Any time an event bubbles up to $('#container'), it checks to see if the event was a click and if the target element of that event matches the CSS selector. If both checks are true, it executes the function.
Notice this is similar to .live(), except that it binds the handler to the specified element instead of the document root. The astute JS’er might conclude that $('a').live() == $(document).delegate('a'), right? Well, no, not exactly.

http://www.alfajango.com/blog/the-difference-between-jquerys-bind-live-and-delegate/?utm_content=backtype-tweetcount&utm_medium=bt.io-twitter&utm_source=netvibes.com

zClip

zClip is a lightweight jQuery "copy to clipboard" plugin built using the popular Zero Clipboard library. This plugin uses an invisible Adobe Flash movie that is fully compatible with Flash Player 10 and below.

http://www.steamdev.com/zclip/

Tuesday, February 8, 2011

Learn How to Find That Perfect Job

This year more and more people have been forced to turn to the internet in hopes of being able to find that perfect job. Many of them are not taking this change with welcome arms and you may be one of them. If you dread going back into the job market to try to find a job that you hope will be able to sustain your level of comfort; then you have come to the right place. When many people have lost their jobs previous year and have found themselves forced to go back to school and get more training on a job that will hopefully pay them the type of money that they want. We hear it everyday on the news when we turn on the television; all the companies that are closing their doors and locking people out.


http://www.careerg.co.cc/2011/02/learn-how-to-find-that-perfect-job.html

Monday, February 7, 2011

JS Libs Deconstructed

The Deconstructed series is designed to visually and interactively deconstruct the internal code of JavaScript libraries, including jQuery, Prototype and MooTools.
It breaks the physical JavaScript into visual blocks that you can easiliy navigate. Each block opens to reveal its internal code. Clickable hyperlinks allow you to follow program flow.

Wednesday, February 2, 2011

BitNami Redmine Stack

BitNami Redmine Stack greatly simplifies the deployment of Redmine and its required dependencies. It can be deployed using a native installer, as a virtual machine, in the cloud or as a module over an already installed infrastructure Stack.
redmine_screenshot2_default.png (640×395)
Redmine is a flexible project management web application. Written using Ruby on Rails framework, it is cross-platform and cross-database. Its main features are:
  • Multiple projects support
  • Flexible role based access control.
  • Flexible issue tracking system
  • Gantt chart and calendar
  • News, documents and files management
  • Feeds and email notifications.
  • Per project wiki
  • Per project forums
  • Simple time tracking functionality
  • Custom fields for issues, projects and users
  • SCM integration (SVNCVS, Mercurial and Darcs)
  • Multiple LDAP authentication support
  • User self-registration support
  • Multilanguage support
  • Multiple databases support

The BitNami Redmine Stack native installers were packaged using BitRock's cross platform installer tool.


BitNami native installers automate the setup of a BitNami application stack on Windows, Linux or Mac OS X. Each installer includes all of the software necessary to run out of the box (the stack). The process is simple; just download, click next-next-next and you are done! BitNami stacks are completely self contained and will not interfere with other software on your system. Learn more about BitNami Native Installers


NestedSet

Nested Set is an implementation of the nested set pattern for ActiveRecord models. It is replacement for acts_as_nested_set and BetterNestedSet, but awesomer. It supports Rails 3.0 and later.

https://github.com/skyeagle/nested_set

Smooth Div Scroll

Smooth Div Scroll is a jQuery plugin that scrolls content horizontally left or right. Apart from many of the other scrolling plugins that have been written for jQuery, Smooth Div Scroll does not limit the scrolling to distinct steps. As the name of the plugin hints, scrolling is smooth. There are no visible buttons or links since the scrolling is done using hotspots within the scrollable area or via autoscrolling. Unobtrusive and smooth is the key here.

Table of contents

  1. What is Smooth Div Scroll?
  2. Quick demo
  3. Basic demo (use as template)
  4. More examples!
  5. Options
  6. Altering options after initialization
  7. Public methods
  8. Callbacks
  9. The CSS
  10. Dependencies
  11. Download
  12. Help and support
  13. Newsletter
  14. Version history
  15. To-do (the next version)
  16. Copyright, license and all that
  17. About me
  18. Nice sites that use Smooth Div Scroll
  19. Please give this plugin a rating
http://www.smoothdivscroll.com/

The iframe cross-domain policy problem

If you are a front-end developer that need to use a cross-domain iframe, you know pain. You could write a nice bit of code and get it working on firefox but it would crash on IE. You would think that would be easy – facebook, twitter and all the others cool kids are doing it! Well, not quite.
Here at Cakemail we are currently building a platform that will enable our users to create forms and embed them in their website directly (think an email list subscription form). So basically, we needed to have javascript control in the parent and in the child.
We had 2 problems to solve based on embedding. One was to change the iframe height dynamically (no way in hell were we going to save the iframe height in a database). And sometimes, depending on what functionality our users embedded in their website, we needed to actually redirect the parent page.

http://www.cakemail.com/blog/the-iframe-cross-domain-policy-problem/