Skip to content

Instantly share code, notes, and snippets.

View loganzartman's full-sized avatar
🏳️‍🌈
support civil liberties

Logan loganzartman

🏳️‍🌈
support civil liberties
View GitHub Profile
@eligrey
eligrey / object-watch.js
Created April 30, 2010 01:38
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
@gre
gre / easing.js
Last active October 30, 2024 16:49
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
@candycode
candycode / image-arraybuffer.js
Created March 7, 2014 15:24
Create a jpg image from ArrayBuffer data
// Simulate a call to Dropbox or other service that can
// return an image as an ArrayBuffer.
var xhr = new XMLHttpRequest();
// Use JSFiddle logo as a sample image to avoid complicating
// this example with cross-domain issues.
xhr.open( "GET", "http://fiddle.jshell.net/img/logo.png", true );
// Ask for the result as an ArrayBuffer.
xhr.responseType = "arraybuffer";
@cboddy
cboddy / pre-commit
Last active December 3, 2019 00:09
pre-commit git hook for python projects to run autopep8 linter
#!/bin/bash
# run autopep8 linter on any python files that are part of the commit
# and modify them in-place to conform to pep8
git diff --cached --name-only | egrep '\.py$' | xargs --no-run-if-empty autopep8 -ri
# re-index files staged for commit
git diff --cached --name-only | egrep '\.py$'| xargs -l git add