- macOS 10.12.3
- Node.js 7.4.0
const childProcess = require('child_process');
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: |
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 |
{ | |
//----------------beginning of editor settings--------------------\\ | |
"editor.comments.ignoreEmptyLines": false, | |
"editor.trimAutoWhitespace": false, | |
"editor.suggest.snippetsPreventQuickSuggestions": false, | |
"editor.definitionLinkOpensInPeek": true, | |
"editor.fastScrollSensitivity": 9, | |
"editor.suggest.shareSuggestSelections": true, | |
"editor.fontSize": 12, | |
"editor.fontFamily": "Consolas, 'Courier New', monospace", |
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 |
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 |
function moneyRawValue(value = 0, decimalSeparator = ",") { | |
if (typeof value === "number") return value; | |
const rawValue = parseFloat( | |
value | |
.replace(/\((?=\d+)(.*)\)/, "-$1") | |
.replace(new RegExp(`[^0-9-${decimalSeparator}]`, "g"), "") | |
.replace(decimalSeparator, ".") | |
); | |
return isNaN(rawValue) ? 0 : rawValue; | |
} |
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) { |
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 |