Skip to content

Instantly share code, notes, and snippets.

(function($){
$.fn.ficus = function(selector){
this.each(function(){
alert('You probably meant $(...).focus(), you numpty');
});
return this;
}
})(jQuery);
@lindsayevans
lindsayevans / jquery.animate-attributes.js
Last active December 15, 2015 17:29
If you haven't felt the need to animate the tabindex attribute, you're not trying hard enough
/*!
* jQuery element attributes CSS hooks & animation support
*
* Copyright © 2013 Lindsay Evans <http://linz.id.au/>
* Licensed under the MIT <http://www.opensource.org/licenses/mit-license.php)> license.
*
* Why?
* Why not
*
* Usage:
<?php
header("HTTP/1.0 ∞ OH GOD WHAT HAVE YOU DONE");
// Adds vendor-prefixed support to $.css for transform & transition
(function($){
if(!$.cssHooks){
throw('jQuery 1.4.3+ is needed for this plugin to work');
}
function styleSupport(prop){
var vendorProp, supportedProp,
capProp = prop.charAt(0).toUpperCase() + prop.slice(1),
(function($){
$.andThen = function(){
return 'No and then!'.toUpperCase();
};
$.dude = function(){
return 'Sweet!';
};
3 Unsafe JavaScript attempt to access frame with URL https://api.twitter.com/xd_receiver.html from frame with URL about:blank. Domains, protocols and ports must match.
console.lol = function(){
(arguments = Array.prototype.slice.call(arguments)).unshift('ROFL: ');
console.log.apply(this, arguments);
};
# In a fresh Rails app created with `rails new`
# App runs fine at this point with `rails server`
$ cat Gemfile
source 'http://rubygems.org'
gem 'rails', '3.0.0'
gem 'sqlite3-ruby', :require => 'sqlite3'
$ bundle install
Using rake (0.8.7)
Using abstract (1.0.0)
# Add correct content-type for fonts
AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType font/x-woff .woff
AddType image/svg+xml .svg
# Compress compressible fonts
AddOutputFilterByType DEFLATE font/ttf font/otf image/svg+xml
@lindsayevans
lindsayevans / log.php
Created January 17, 2011 20:29
HTML5 video request headers
Firefox 4.0b9:
Array
(
[Host] => localhost
[User-Agent] => Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b9) Gecko/20100101 Firefox/4.0b9
[Accept] => video/webm,video/ogg,video/*;q=0.9,application/ogg;q=0.7,audio/*;q=0.6,*/*;q=0.5
[Accept-Language] => en-us,en;q=0.5
[Accept-Charset] => ISO-8859-1,utf-8;q=0.7,*;q=0.7
[Keep-Alive] => 115
[Connection] => keep-alive