jQuery Spritely | Spritely
jQuery.spritely is a jQuery plugin created by Artlogic for creating dynamic character and background animation in pure HTML and JavaScript. It's a simple, light-weight plugin with a few simple methods for creating animated sprites such as the birds you see on this page, and dynamic scrolling backgrounds.
CoffeeScript
Imagine all the syntactical delights of Ruby and Haml for your JavaScript. You write in a nice language, but get normal JavaScript at runtime. All whilst having full access to 3rd-party JavaScript libraries (jQuery, PrototypeJS), debugging support (it becomes pure, readable JavaScript), existing support from test suites (it’s normal JavaScript) and growing support from various text editors (TextMate, Vim, Emacs).
LukeW | "Mad Libs" Style Form Increases Conversion 25-40%
A while ago, I came across a unique registration form built by Jeremy Keith for his audio sharing site, Huffduffer. Though it asked people the same questions found in typical sign-up forms, the Huffduffer registration form did so in a narrative format. It presented input fields to people as blanks within sentences (Mad Libs-style, if you will).
Voodoo Doll to Kill Internet Explorer | Walyou
The hatred of the users for the Internet Explorer browser has reached such a height that now a Voodoo Doll has been made to help show one’s anger for this browser out on this doll.
If you code HTML, Zen Coding will change your life
This thing leaves any other tag-completion method I have ever seen for HTML in the dust. It's light-years beyond anything else I've witnessed -- and autocompletion is something I've looked into deeply, with multiple editors and IDEs.
Why I won't help you - Gem Session
But then there are those posts where the author pastes 10 pages of confused code with no context whatsoever and then demands to know why they're getting funny errors. I find this sort of behaviour offensive to all the people who are basically dealing out free support. I'd rather spend my time helping people who actually give a damn.
jnicklas's carrierwave at master - GitHub
File upload solution that supports form roundtrips when a validation fails.
A tracer utility in 2kb « JavaScript, JavaScript
Inspired by a snippet of code in Oliver Steele’s legendary Functional library, here’s a lightweight tool to help keep track of JavaScript invocations. It works in Chrome, Safari, Firebug and IE8.
wkhtmltopdf - Project Hosting on Google Code
Simple shell utility to convert html to pdf using the webkit rendering engine, and qt.
Less.js Will Obsolete CSS
Less.js is a JavaScript implementation of LESS that’s run by your web browser. As any JavaScript, you include a link to the script in your HTML, and…that’s that. LESS is now going to process LESS code so instead of including a link to a CSS file, you’ll include a link directly to your LESS code. That’s right, no CSS pre-processing, LESS will handle it live.
thoughtbot's bourne at master - GitHub
Test spies are a form of test double that preserves the normal four-phase unit
Copy a Paperclip attachment to another record
Just assign the existing attachment to another record:
new_photo = Photo.new
new_photo.image = old_photo.image
Paperclip will duplicate the file when saving.
To use this in forms, pimp your attachment container like this:
class Photo < ActiveRecord::Base
has_attached_file :image
attr_accessor :copy_of
def image_url
if copy_of
copy_of.url
else
image.url
end
end
end
And in the controller do:
new_photo = Photo.new(:copy_of => old_photo)
Unobtrusive JavaScript and AJAX
Attached (see below) is some code to allow using unobtrusive JavaScript on pages fetched with an AJAX call.
After you included it, you now do not use the usual
$(function() {
$('.some_tag').activateStuff();
});
any more, but instead you write
$.unobtrusive(function() {
$(this).find('.some_tag').activateStuff();
});
that is
-
$.unobtrusive()
instead of$()
- don't do stuff to the whole page, but just to elements nested below
$(this)
Normal pages work as before (your $.unobtrusive
functions are ca...