Skip to content

Instantly share code, notes, and snippets.

View jerrygreen's full-sized avatar

Jerry Green jerrygreen

View GitHub Profile
@klaaspieter
klaaspieter / gist:908433
Last active November 14, 2020 14:13
Get a revision number from git by counting the number of commits
git rev-list --count --all
@beastaugh
beastaugh / fib.js
Created September 30, 2009 13:52
Calculate Fibonacci numbers in JavaScript
/**
* The Fibonacci numbers in JavaScript.
*
* A cached solution with O(1) lookup for previously-calculated terms and O(N)
* lookup for uncalculated ones.
*
* Because numbers in JavaScript are 64bit, the largest available number is
* 1.7976931348623157e+308. The 1476th term is the last that can be calculated.
* If a later term is requested, the function will return Infinity.
*