Skip to content

Instantly share code, notes, and snippets.

View nyxcharon's full-sized avatar

Barry Martin nyxcharon

View GitHub Profile
### Keybase proof
I hereby claim:
* I am nyxcharon on github.
* I am nyxcharon (https://keybase.io/nyxcharon) on keybase.
* I have a public key ASCssh__tNbKQ1OLSrWBB9eq8G1yyWgeq6sLUbkl1VILqAo
To claim this, I am signing this object:
@nyxcharon
nyxcharon / gist:5860750
Created June 25, 2013 17:59
Using shift in bash
while [ "$1" != "" ]; do
if [ "$1" == "--hostname" ]; then
HOSTNAME=${2}; shift
echo "Hostname Defined: ${HOSTNAME}"
elif [ "$1" == "--base-image" ]; then
BASEIMAGE=${2}; shift
echo "Base-image defined: ${BASEIMAGE}"
elif [ "$1" == "--test" ]; then
TEST=true; shift
elif [ "$1" == "--help" ]; then
@nyxcharon
nyxcharon / Get 8 char git hash
Created June 14, 2013 14:38
Get 8 char git hash
git ls-remote git://github.com/nyxcharon/Test.git | cut -f1 | sed 's/.\{32\}$//'
@nyxcharon
nyxcharon / Set mac audio from terminal
Last active December 18, 2015 10:09
Set mac audio level from terminal
alias shutup='osascript -e 'set volume 0''
@nyxcharon
nyxcharon / Add a new repo via terminal
Last active December 18, 2015 10:09
Remotely created new repo
curl -u 'USER' https://api.github.com/user/repos -d '{"name":"REPO","description":"DESC"}'
git remote add origin git@github.com:USER/REPO.git
git push origin master
USER=Username
REPO=Repo Name
DESC= Your repo description
@nyxcharon
nyxcharon / Get api value from terminal
Last active December 18, 2015 09:09
Grab github api value via bash
#!/bin/bash
function jsonval
{
echo `curl -s -X GET https://api.github.com/users/adonislinux/repos | grep $prop | awk '{ sub(/\"'''$prop'''\": /, ""); print}' | tr \", " "`
}
prop="ssh_url"
urls=`jsonval`