- macOS 10.12.3
- Node.js 7.4.0
const childProcess = require('child_process');
REMOTE=origin | |
BRANCH=$(git rev-parse --abbrev-ref HEAD) | |
BATCH_SIZE=10 | |
# check if the branch exists on the remote | |
# if git show-ref --quiet --verify refs/remotes/$REMOTE/$BRANCH; then | |
# # if so, only push the commits that are not on the remote already | |
# range=$REMOTE/$BRANCH..HEAD | |
# else | |
# # else push all the commits |
const cluster = require('cluster'); | |
const http = require('http'); | |
const numCPUs = require('os').cpus().length; | |
if (cluster.isMaster) { | |
console.log(`Master ${process.pid} is running`); | |
// Fork workers. | |
for (let i = 0; i < numCPUs; i++) { |
The MIT License (MIT) | |
Copyright (c) 2015 Justin Perry | |
Permission is hereby granted, free of charge, to any person obtaining a copy of | |
this software and associated documentation files (the "Software"), to deal in | |
the Software without restriction, including without limitation the rights to | |
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | |
the Software, and to permit persons to whom the Software is furnished to do so, | |
subject to the following conditions: |
var elements = document.querySelectorAll("div"), | |
callback = (el) => { console.log(el); }; | |
// Spread operator | |
[...elements].forEach(callback); | |
// Array.from() | |
Array.from(elements).forEach(callback); | |
// for...of statement |
Interactive Spectrogram in the browser!
Same as example in: https://github.com/vlandham/spectrogramJS - but in blocks.
Click 'analyze' to play the sound and create spectrogram.
Uses web audio api.
Also uses D3 with canvas to display the main visualization.
var endpoint = 'https://graph.facebook.com/fql'; | |
var accessToken = ''; | |
var userId = ''; | |
var q = 'SELECT caption, src_big FROM photo WHERE aid IN(SELECT aid FROM album WHERE owner = ' + userId + ' ORDER BY modified DESC LIMIT 1) ORDER BY modified DESC LIMIT 1'; | |
var url = endpoint + '?access_token=' + accessToken + '&q=' + q; |
function getRecentInstagramPhotos(userId, accessToken, count, cb) { | |
var url = 'https://api.instagram.com/v1/users/' + userId + '/media/recent?access_token=' + accessToken + '&count=' + count; | |
$.getJSON(url, function (response) { | |
cb(response.data); | |
}); | |
} | |
var userId = ''; | |
var accessToken = ''; | |
getRecentInstagramPhotos(userId, accessToken, 20, function (photos) { |
Reference: http://gitimmersion.com/ | |
# Pretty Git log | |
alias glog='git log --pretty="format:%C(yellow)%h %C(green)%s%C(blue)%d%C(white) - %ar - %an - %ad" --graph --date=short' | |
hist= log --pretty=format:\"%C(yellow)%h%Creset %ad | %C(green)%s%C(blue)%d%Creset [%an]\" --graph --date=short | |
# Reverting a Commit (safe in pushed to a remote branch) | |
git revert HEAD | |
# REMOVING COMMITS FROM A BRANCH |
git checkout master | |
git checkout -b bug123 | |
git pull http://repourl.git branch | |
git log | grep "Author" | head -1 # get the author | |
git checkout master | |
git merge --squash bug123 | |
git commit -a --author="Author" --message="Close #1: Title. Fixes #666" | |
git push origin master |