Skip to content

Instantly share code, notes, and snippets.

View young-steveo's full-sized avatar
🦑
Workin'

Stephen Young young-steveo

🦑
Workin'
View GitHub Profile
@WebReflection
WebReflection / fast-bind.js
Last active March 27, 2021 18:29
Function.prototype.bind performance problem solved in JS … (at least for 90% of common cases without partial args)
/*jslint indent: 2 */
(function (FunctionPrototype) {
'use strict';
var originalBind = FunctionPrototype.bind;
if (!originalBind.patched) {
Object.defineProperty(
FunctionPrototype,
'bind',
{
configurable: true,
@twhid
twhid / gist:2648062
Created May 9, 2012 19:05
grunt task to deploy JS files to S3 with awssum
grunt.registerMultiTask('s3deploy', 'deploy to S3 using awssum', function () {
// dependencies
var awssum = require('awssum'),
fs = require('fs'),
path = require('path'),
aws = require('./settings').aws;
var amz = awssum.load('amazon/amazon'),
AmazonS3 = awssum.load('amazon/s3'),
s3 = new AmazonS3(aws.accessKey, aws.secretKey, aws.accountId , amz.US_EAST_1),
@paulirish
paulirish / rAF.js
Last active March 22, 2024 00:00
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'];