Skip to content

Instantly share code, notes, and snippets.

View turusuke's full-sized avatar
🏠
Working from Home

turusuke turusuke

🏠
Working from Home
View GitHub Profile
@banksean
banksean / perlin-noise-classical.js
Created February 15, 2010 10:00
two Perlin noise generators in javascript. The simplex version is about 10% faster (in Chrome at least, haven't tried other browsers)
// Ported from Stefan Gustavson's java implementation
// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
// Read Stefan's excellent paper for details on how this code works.
//
// Sean McCullough [email protected]
/**
* You can pass in a random number generator object if you like.
* It is assumed to have a random() method.
*/
@paulirish
paulirish / rAF.js
Last active November 11, 2024 03:20
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@psebborn
psebborn / countCSSRules.js
Last active April 25, 2023 11:43
Count the number of rules and selectors for CSS files on the page. Flags up the >4096 threshold that confuses IE
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {
@bhollis
bhollis / .htaccess
Created March 25, 2012 22:58
Serving pre-gzipped assets from Apache
AddEncoding gzip .gz
RewriteEngine on
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{HTTP_USER_AGENT} !Konqueror
RewriteCond %{REQUEST_FILENAME}.gz -f
RewriteRule ^(.*)\.css$ $1.css.gz [QSA,L]
RewriteRule ^(.*)\.js$ $1.js.gz [QSA,L]
RewriteRule ^(.*)\.html$ $1.html.gz [QSA,L]
@hail2u
hail2u / twitter-bird.svg
Created June 6, 2012 20:39
SVG version of the new Twitter bird.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zdennis
zdennis / config.rb
Created July 3, 2012 23:49
Make Middleman compile coffee-script using bare mode.
#
# Add the following to Middleman's config.rb:
#
CoffeeScript.class_eval do
class << self
def compile_with_bare(*args)
options = args.pop if args.last.is_a?(Hash)
(options ||= {})[:bare] = true
args << options
@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: [email protected]
var timeouts = {};
@mattintosh4
mattintosh4 / 0-README.md
Last active June 4, 2022 21:41
Automator 用シェルクリプト集 その1

Shell script for Automator Part.1

Automator のシェルスクリプトアクションで使えるサンプル集です。「アプリケーション」や「サービス」を作成するときにどうぞ。


入力の種類について

@azusa-tomita
azusa-tomita / bootcamp.md
Last active December 29, 2015 17:18
sassで使えるテストツールbootcampについて

bootcampとは

bootcamp

macでwindowsが動くアレでもなく、マッチョな黒人に励まされながら踊るアレでもなく sassのfunctionをテストするためのフレームワーク。

もともとジャスミンというJavascriptのBDDテスト用のフレームワークがあり、 その書き方でsassのfunctionをテストできるようにしたものらしい