Tiny Cross-browser DOM ready function in 111 bytes of JavaScript.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin ie() { | |
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { | |
@content; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root = "/fullpath/your_project/current" | |
working_directory root | |
pid "#{root}/tmp/pids/unicorn.pid" | |
stderr_path "#{root}/log/unicorn.error.log" | |
stdout_path "#{root}/log/unicorn.log" | |
listen 8080 | |
worker_processes 2 | |
timeout 30 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here is a list of scopes to use in Sublime Text 2 snippets - | |
ActionScript: source.actionscript.2 | |
AppleScript: source.applescript | |
ASP: source.asp | |
Batch FIle: source.dosbatch | |
C#: source.cs | |
C++: source.c++ | |
Clojure: source.clojure | |
CoffeeScript: source.coffee |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ios7bottom | |
* | |
* Listen to changes in safari window size to ensure the position:fixed | |
* elements are always visible. | |
* | |
* Usage | |
* | |
* $('#toolbar').ios7bottom(); | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Send a form with a link with data-form="#form_id" | |
/ You can define params="name,value name,value" | |
/ All params will be append to the form as hidden inputs before send it | |
*/ | |
$('body').on('click', '[data-form]', function(e) { | |
e.preventDefault(); | |
var el = $(this), | |
form = $(el.data('form')), | |
params; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
$.fn.plugin = function() { | |
return this.each(function() { | |
var $this = $( this ); | |
if ( !$this.data('plugin') ) { | |
$this.data( 'plugin', new Plugin(this) ); | |
} | |
}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin font-face($font-family, $file-path, $weight: normal, $style: normal) { | |
@font-face { | |
font-family: $font-family; | |
font-weight: $weight; | |
font-style: $style; | |
src: font-url('#{$file-path}.eot'); | |
src: font-url('#{$file-path}.eot?#iefix') format('embedded-opentype'), | |
font-url('#{$file-path}.woff') format('woff'), | |
font-url('#{$file-path}.ttf') format('truetype'), | |
font-url('#{$file-path}.svg##{$font-family}') format('svg'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /><![endif]--> | |
<!--[if lt IE 7 ]> <html lang="<%= ::I18n.locale %>" class="no-js ie6"> <![endif]--> | |
<!--[if IE 7 ]> <html lang="<%= ::I18n.locale %>" class="no-js ie7"> <![endif]--> | |
<!--[if IE 8 ]> <html lang="<%= ::I18n.locale %>" class="no-js ie8"> <![endif]--> | |
<!--[if IE 9 ]> <html lang="<%= ::I18n.locale %>" class="no-js ie9"> <![endif]--> | |
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="<%= ::I18n.locale %>" class="no-js"> <!--<![endif]--> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Paste into Firebug or Chrome Dev Tools console | |
// when viewing a page with multiple checkboxes. | |
(function(d) { | |
var input = d.getElementsByTagName('input'); | |
var i = input.length; | |
while (i--) { | |
if (input[i].type === 'checkbox') { | |
input[i].setAttribute('checked', 'checked'); |