Skip to content

Instantly share code, notes, and snippets.

@shawndumas
shawndumas / partialApplication.js
Last active August 29, 2015 14:09
Partial Application with Substitution
var partial = function () {
var toArray = function (a) { return [].slice.call(a); },
appliedArgs = toArray(arguments),
fn = appliedArgs.shift(),
placeholderPositions = appliedArgs.map(function (e, i) {
if (e === '_') { return i; }
}).join('').split('');
return function () {
var args = toArray(arguments);
@jtangelder
jtangelder / PreventGhostClick.js
Last active January 17, 2024 21:55
PreventGhostClick
/**
* Prevent click events after a touchend.
*
* Inspired/copy-paste from this article of Google by Ryan Fioravanti
* https://developers.google.com/mobile/articles/fast_buttons#ghost
*
* USAGE:
* Prevent the click event for an certain element
* ````
* PreventGhostClick(myElement);
@iclanzan
iclanzan / components.md
Last active May 4, 2024 01:57
UI Component Name Ideas

UI component names

As front-end developers we all know the pain of coming up with meaningful component names for CSS classes. I created this gist as a place to collect terms that are suitable as user interface component names.

Please contribute your own ideas!

Interactive components

  • button
@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.
*/