Skip to content

Instantly share code, notes, and snippets.

View jakiestfu's full-sized avatar
🍊

Jacob Kelley jakiestfu

🍊
View GitHub Profile
This file has been truncated, but you can view the full file.
'use strict';
var COMPILED = !0, goog = goog || {};
goog.global = this;
goog.DEBUG = !1;
goog.LOCALE = "en";
goog.provide = function (a) {
if (!COMPILED) {
if (goog.isProvided_(a))
throw Error('Namespace "' + a + '" already declared.');
var log = (function() {
var _log = console ? console.log.bind(console) : Function.prototype.valueOf();
return function() {
if (exports.debug) {
var args = Array.prototype.slice.call(arguments);
_log.apply(null, args);
}
};
})(),
$ = jQuery
queues = {}
running = false
queue = (name) ->
name = 'default' if name is true
queues[name] or= []
next = (name) ->
@jakiestfu
jakiestfu / ko-money.js
Last active February 14, 2018 10:46
Used to display formatted money via Knockout binding
(function(){
var toMoney = function(num){
return '$' + (num.toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,') );
};
var handler = function(element, valueAccessor, allBindings){
var $el = $(element);
var method;
@jakiestfu
jakiestfu / git.config.sh
Last active April 16, 2016 03:40
My favorite git snippets/settings
git config --global color.ui true
git config --global alias.undo-commit 'reset --soft HEAD^'
git config --global push.default current
@jakiestfu
jakiestfu / package.json
Last active January 3, 2016 12:49
Potential Medium.js Package.json
{
"name": "Medium.js",
"version": "1.0.0",
"repository": {
"type": "git",
"url": "https://github.com/jakiestfu/Medium.js"
},
"dependencies": {
"rangy": "https://github.com/jackcviers/Rangy",
"undo": "https://github.com/jzaefferer/undo"
@jakiestfu
jakiestfu / rdiff.sh
Last active August 29, 2015 13:57
Git Remote Diff: Open the latest commit diff in GitHub
git config --global alias.rdiff '!g() { origin=`git config --get remote.origin.url`; origin=${origin/git@github.com:/https://github.com/}; url=${origin/.git/\/commit\/`git rev-parse HEAD`}; open $url; }; g'
@jakiestfu
jakiestfu / ko-else.js
Created May 28, 2014 05:42
This is an almost working "else" binding for Knockout.js. It monkey patches the "if" binding and keeps a stack of the last returned values from the bindings. Every "else" binding is actually an if binding with the negated value of the last if bindings return set in a preprocessor. Currently doesn't work with multiple bindings. DOH!
(function(){
var bindingKey = 'else',
stack = [],
_if = ko.bindingHandlers.if,
_init = _if.init
_update = _if.update;
ko.bindingHandlers[bindingKey] =
{
@jakiestfu
jakiestfu / git_rdiff.sh
Last active January 4, 2024 20:42
git rdiff
git config --global alias.rdiff '!g() { origin=$(git config --get remote.origin.url | sed "s/git@/https:\/\//g" | sed "s/.com:/.com\//g"); url=${origin/.git/\/commit\/$(git rev-parse HEAD)}; open $url; }; g'
@jakiestfu
jakiestfu / ko.else.js
Created October 17, 2014 14:50
An attempt to create an "else" binding with Knockout. Only supports linear statements, no depth.
(function(){
var bindingKey = 'else',
stack = [],
_if = ko.bindingHandlers.if,
_init = _if.init
_update = _if.update;
ko.bindingHandlers[bindingKey] =
{