Help with SQL commands to interact with a MySQL database
- Mac /usr/local/mysql/bin
- Windows /Program Files/MySQL/MySQL version/bin
- Xampp /xampp/mysql/bin
//Example 1 - Calculate average value of an array (transform array into a single number) | |
var scores = [89, 76, 47, 95] | |
var initialValue = 0 | |
var reducer = function (accumulator, item) { | |
return accumulator + item | |
} | |
var total = scores.reduce(reducer, initialValue) | |
var average = total / scores.length | |
/*Explain about function |
At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.
git commit --amend
This will open your $EDITOR
and let you change the message. Continue with your usual git push origin master
.
##Create a new repository on the command line
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin [email protected]:alexpchin/.git
% cd (your git repo) | |
% for remote in `git branch -r | grep -v master | grep -v develop`; do git checkout --track $remote ; done | |
# Once you have all branches.... | |
% git for-each-ref --sort=-committerdate refs/heads/ --format='%(committerdate:short)%09 %(refname:short)%09 %(authorname)' | column -t | |
# ... or just show me the same info for all merged branches |
// From http://baagoe.com/en/RandomMusings/javascript/ | |
function Alea() { | |
return (function(args) { | |
// Johannes Baagøe <[email protected]>, 2010 | |
var s0 = 0; | |
var s1 = 0; | |
var s2 = 0; | |
var c = 1; | |
if (args.length == 0) { |