git add -N . && git add -p "./*foo*"
git add -N . && git add -p
# Test it first: | |
# Change master by the name of the branch you want to keep, the branches showing will be eliminated | |
git branch | grep -v "master" | |
# Eliminate branches with xargs | |
git branch | grep -v "master" | xargs git branch -D |
/** | |
* scrollProgr.js | |
* Scroll progresively to the bottom of a page. | |
* | |
* param: jump Number: Pixels to jump in each scroll | |
* param: time Number: ms between each scroll | |
* param: maxDistance Number: Don't do more jumps after surpassing this number | |
* param: timeou Number: Kill the scrolling after this number of ms | |
* | |
* return <promise> undefined | String |
function generateRandom(max, min){ | |
if (typeof max !== 'number' | typeof min !== 'number') throw new Error('max and min should be numbers') | |
if (min > max) throw new Error('max should be bigger than min') | |
return Math.floor(Math.random() * (max - min + 1)) + min | |
} |
document.addEventListener ("keydown", function (e) { | |
if (e.ctrlKey && e.key === "1") { | |
alert('pressed ctrl + 1') | |
} | |
} ); |
// To push branch 'deploy' | |
git push heroku deploy:master |
const sliceExtra = (str, limit) => str.length < limit ? str : str.slice(0, limit) + '...' |
// If you wanted to get between 1 and 6, you would calculate: | |
Math.floor(Math.random() * 6) + 1 | |
// 1 is the start number | |
// 6 is the number of possible results (1 + start (6) - end (1)) |
async function printFiles () { | |
const files = await getFilePaths(); | |
await Promise.all(files.map(async (file) => { | |
const contents = await fs.readFile(file, 'utf8') | |
console.log(contents) | |
})); | |
} | |
/// koa example |
Imagination is the key to painting. If you don't think every day is a good day - try missing a few. You'll see. And just raise cain. Any little thing can be your friend if you let it be. | |
This present moment is perfect simply due to the fact you're experiencing it. And that's when it becomes fun - you don't have to spend your time thinking about what's happening - you just let it happen. That's the way I look when I get home late; black and blue. | |
I'm gonna start with a little Alizarin crimson and a touch of Prussian blue Just make little strokes like that. You are only limited by your imagination. Very easy to work these to death. Get away from those little Christmas tree things we used to make in school. | |
If you hypnotize it, it will go away. Put light against light - you have nothing. Put dark against dark - you have nothing. It's the contrast of light and dark that each give the other one meaning. Now we don't want him to get lonely, so we'll give him a little friend. Trees get lonely too, so we'll give h |