git config --global core.excludesfile '~/.gitignore'
const booksList = [ | |
'1', | |
'The Stranger\nThe Outsider', | |
'Albert Camus', | |
'1942', | |
'French', | |
'2', | |
'In Search of Lost Time\nRemembrance of Things Past', | |
'Marcel Proust', | |
'1913–27', |
#!/usr/bin/env bash | |
# removes all remote deleted branches from local sandbox | |
git branch -vv | grep 'origin/.*: gone]' | awk '{print $1}' | xargs git branch -d |
git reset $(git merge-base master $(git rev-parse --abbrev-ref HEAD)) |
/** | |
* Adds a `getAsyncTwin()` method to the prototype of Knockout's ObservableArray | |
* returning a new ObservableArray that will be a continuous non-instant copy of the original. | |
* Whenever the original ObservableArray changes, the copy will be populated | |
* in chunks of a given size and with a given delay between the chunks until it is identical to the original. | |
* | |
* Intended to allow rendering the first (visible) part of huge lists faster before all the rest. | |
* | |
* Example: | |
* |
// UMD dance - https://github.com/umdjs/umd | |
!function(root, factory) { | |
if (typeof define === 'function' && define.amd) { | |
define(['jquery'], factory); | |
} else { | |
factory(root.jQuery); | |
} | |
}(this, function($) { | |
'use strict'; |
// DyRGS - dynamic responsive grid system | |
// @author: karsten.rieger@tritium-design.de | |
@gutter: 1.5625%; // ~= 10px gutter @ 320px width | |
@mobile-column-count: 4; | |
@tablet-column-count: 8; | |
@desktop-column-count: 12; | |
@mobile-selector: m; | |
@tablet-selector: t; | |
@desktop-selector: d; |
Array.prototype.shuffle = Array.prototype.shuffle || (function () { | |
function shuffle(array) { | |
var currentIndex = array.length | |
, temporaryValue | |
, randomIndex | |
; | |
// While there remain elements to shuffle... | |
while (0 !== currentIndex) { | |
var before = function(fn, pre) { | |
return function() { | |
pre.apply(this, arguments); | |
return fn.apply(this, arguments); | |
}; | |
}, | |
after = function(fn, aft) { | |
return function() { | |
var result = fn.apply(this, arguments); | |
aft.apply(this, result); |
/* | |
Problem: how many collectible packets need to be bought to achieve a complete set, | |
when you don't know which one is in the packet. | |
i.e. There are 16 unique trading cards to complete a set. Each is sold in a sealed enclosing. | |
How many of them would it take to collect all 16? | |
answer: about 54! | |
https://plus.google.com/u/0/104223386721240823159/posts/goRYigJ4RGB | |
*/ | |
var countCollectibles = function (collectibleCount) { | |
var eulerConstant = 0.5772156649; |