git update-index --assume-unchanged dir-im-removing/
git update-index --assume-unchanged config/database.yml
git update-index --skip-worktree
git rebase -i <earliercommit>
git commit --amend --author="Author Name <email@address.com>"
git update-index --assume-unchanged dir-im-removing/
git update-index --assume-unchanged config/database.yml
git update-index --skip-worktree
git rebase -i <earliercommit>
git commit --amend --author="Author Name <email@address.com>"
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env node | |
const sumit = (sum, it) => sum + it | |
// Christmas is around us! | |
const christmasPresentsPerDays = (days = 12) => { | |
const bag = []; | |
for (let i = 0; i < days; i++) { | |
bag.push(i + 1 + bag[i - 1] || 1); | |
} | |
return bag.reduce(sumit, 0); |
function fibonacciSum(n) { | |
'use strict'; | |
var | |
sequence = fibonacci(n); | |
return sequence.reduce(function(a, b) { | |
return a + b; | |
}); | |
} |
#!/usr/bin/env node | |
console.log('Nishtyak!') |
function padding(num, sep) { | |
var numarr = num['toString']().split('') | |
var numarrLen = numarr.length | |
var out = [] | |
for (;numarrLen--;) { | |
var num = numarr[numarrLen] | |
out.unshift(num) | |
if (numarr.length !== numarrLen && num % 3 === 0) out.unshift(sep) | |
} | |
return out.join('') |
function hashStr2JSON (str) { | |
try { | |
return Function('return ' + str)(); | |
} catch(e) { | |
// something goes wild | |
throw new Error('Could not parse hash because of: ' + e.toString()) | |
} | |
} | |
var jsonfromhash = hashStr2JSON('{a:/*comment*/"b"}//comment'); // read hash string, it will also work with multiline files |
function sortJsonByKeys (json) { | |
let out = {} | |
let keys = Object.keys(json) | |
keys.sort() | |
keys.forEach((key) => { | |
if (typeof json[key] === 'object') { | |
out[key] = sortJsonByKeys(json[key]) | |
} else { | |
out[key] = json[key] | |
} |
function mapRomanToArabic (roman) { | |
switch(roman) { | |
case 'I': | |
return 1 | |
case 'V': | |
return 5 | |
case 'X': | |
return 10 | |
case 'L': | |
return 50 |
function findSumPairs(arr, sum) { | |
'use strict'; | |
var | |
i = 0, | |
j = 0, | |
isum, | |
imatch, | |
out = [], | |
larr; |