Skip to content

Instantly share code, notes, and snippets.

@mathiasbynens
mathiasbynens / setZeroTimeout.js
Created September 14, 2010 22:23
Cross-browser-compatible setZeroTimeout
/*! Cross-browser-compatible setZeroTimeout
*
* I took the original setZeroTimeout and made it cross-browser-compatible, using setTimeout(fn, 0) as a fallback in case postMessage is not supported.
* Mathias Bynens <http://mathiasbynens.be/>
* See <http://mathiasbynens.be/notes/settimeout-onload>
*
* Copyright statement below:
*
* See <http://dbaron.org/log/20100309-faster-timeouts>
* By L. David Baron <dbaron@dbaron.org>, 2010-03-07, 2010-03-09
@benjamine
benjamine / README.mdown
Created May 30, 2011 16:04 — forked from mathewbyrne/README.mdown
An asynchronous method for embedding gists in an HTML document using jQuery.

A quick jQuery plugin for asynchronously embedding a gist in an HTML document.

There are a couple of ways to use it. The simpler way is replacing all Gist links in document by their embedded version:

<script>$($.gist);</script>

All links that point to a gist, or gist file will be replaced by the corresponding embedded gist, or gist file.

Gist link replacement can also be called on a container element:

@goofmint
goofmint / gist:2340855
Created April 9, 2012 02:13
Pot.js demo
// 関数名を短縮化
Pot.globalize();
begin(function() {
debug('BEGIN example');
}).then(function() {
debug('BEGIN request');
// JSON を取得
@yuya-matsushima
yuya-matsushima / .e2esound.vim
Created June 16, 2012 05:31
とりあえずこれだけあれば…的な
" e2esound color scheme based on ir_black
set background=dark
hi clear
if exists("syntax_on")
syntax reset
endif
let g:colors_name = "e2esound"
@hitode909
hitode909 / blog-retina.js
Created August 9, 2012 11:31
はてなブログを小刻みに揺らす.js
(function() {
var requestAnimationFrame = (function() {
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(callback, element) {
return window.setTimeout(function() {
return callback();
}, 1000 / 60);
};
})();
var i=0;
@rosylilly
rosylilly / gist:3401612
Created August 20, 2012 06:40
先輩と覚える HTTP ステータスコード

先輩に学ぶ HTTP Status Code

超雑にまとめました。修正してください。

登場人物

  • アプリケーション先輩: いつも忙しい。横に広がるのが得意(デブじゃない)。
  • 後輩: 頼んでばっかしで役に立たない。
  • サーバー先輩: アプリケーション先輩と仲がいい。Unix Socket でつながるくらい仲良し。
  • プロクシ先輩: アプリケーション先輩とかサーバー先輩と後輩の間を取り持って代わりに伝えたりしてくれる。たまに勝手にレスポンスを書き換える。
@ronkorving
ronkorving / ios6-timers.js
Last active March 9, 2022 03:40
iOS6 webkit timer bug workaround
(function (window) {
// This library re-implements setTimeout, setInterval, clearTimeout, clearInterval for iOS6.
// iOS6 suffers from a bug that kills timers that are created while a page is scrolling.
// This library fixes that problem by recreating timers after scrolling finishes (with interval correction).
// This code is released in the public domain. Do with it what you want, without limitations. I do not promise
// that it works, or that I will provide support (don't sue me).
// Author: rkorving@wizcorp.jp
var timeouts = {};
@gaspanik
gaspanik / rubyonrails.md
Created September 30, 2012 14:50
Install: Install RoR on 10.8.x
@studiomohawk
studiomohawk / .csslintrc
Created October 18, 2012 07:44
.csslintrc
--ignore=adjoining-classes,compatible-vendor-prefixes,display-property-grouping,box-model,outline-none