Skip to content

Instantly share code, notes, and snippets.

@magnetikonline
magnetikonline / README.md
Last active April 30, 2024 00:45
Setting Nginx FastCGI response buffer sizes.
@bellbind
bellbind / fire.html
Last active June 8, 2016 10:06
[javascript][html5]replacement of setInterval(frame, framems) with requestAnimationFrame(callback(now))
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<script src="fire.js"></script>
</head>
<body>
<canvas id="canvas" width="300" height="300" style="background-color: white"
></canvas>
</body>
@potfur
potfur / $.js
Last active February 15, 2023 14:49
window.S = function(s) {
return document[{
'#': 'getElementById',
'.': 'getElementsByClassName',
'@': 'getElementsByName',
'=': 'getElementsByTagName'}[s[0]]
|| 'querySelectorAll'](s.slice(1))
};
// [S('#header'), S('.container'), S('?div')]
@cowboy
cowboy / ba-backbone-module.js
Created September 9, 2011 18:05
Idea for a Backbone module system (allowing modules to be accessed across multiple files, possibly loaded out of order). Inspired by https://gist.github.com/1202511
/*!
* Backbone Module Manager - v0.1pre - 9/9/2011
* http://benalman.com/
*
* Copyright (c) 2011 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
function ModuleManager(fn) {
@joelambert
joelambert / README
Created June 1, 2011 11:03
Drop in replacements for setTimeout()/setInterval() that makes use of requestAnimationFrame() where possible for better performance
Drop in replace functions for setTimeout() & setInterval() that
make use of requestAnimationFrame() for performance where available
http://www.joelambert.co.uk
Copyright 2011, Joe Lambert.
Free to use under the MIT license.
http://www.opensource.org/licenses/mit-license.php
@jasonwyatt
jasonwyatt / polylinefade.js
Created November 18, 2010 17:13
Fade out a google maps polyline.
function fadeOut(line, keepAround, fadeDuration){
keepAround = keepAround || 1000;
fadeDuration = fadeDuration || 500;
setTimeout(function(){
var startingOpacity = line.strokeOpacity,
startTime = (new Date()).getTime();
function step(){
var currentTime = (new Date()).getTime(),