Skip to content

Instantly share code, notes, and snippets.

View JesseHerrick's full-sized avatar

Jesse Herrick JesseHerrick

View GitHub Profile
@JesseHerrick
JesseHerrick / JSON-for-Your-Thoughts.json
Last active August 29, 2015 14:00
Code samples from my blog post "JSON for Your Thoughts"
{
"postData": {
"title": "JSON for Your Thoughts",
"date": "2014-05-01"
},
"outline": {
"why": "why you should use this",
"what": "what JSON is",
"how": "how to write it",
@JesseHerrick
JesseHerrick / kill-ie.js
Created April 19, 2014 17:03
Done with IE support? *evil laugh*
if (window.navigator.userAgent.indexOf("IE") >= 0) {
console.log("This guy is running IE. Get us out of here!!!");
window.alert("Get a better browser.");
window.location("http://chrome.google.com");
}

Is this the real life? Is this just fantasy? Caught in a landslide No escape from reality Open your eyes Look up to the skies and see I'm just a poor boy, I need no sympathy Because I'm easy come, easy go A little high, little low Anyway the wind blows, doesn't really matter to me, to me

# file: rest-server.rb
require 'sinatra'
# all status codes given are based on W3C standards
get '/' do
'Here is some data.'
end
post '/' do
#!/usr/bin/env bash
git remote add upstream $1
git pull origin HEAD # make sure it's recent
git fetch upstream HEAD # fetch origin's fork changes
git merge upstream/HEAD &>/dev/null || git rebase upstream/master # apply changes
git rebase HEAD # keep HEAD at the top
git push origin HEAD # push changes
@JesseHerrick
JesseHerrick / gist:9669360
Created March 20, 2014 17:33
Fix git pull error.
git fetch
git rebase origin/master
@JesseHerrick
JesseHerrick / check-command.sh
Created January 18, 2014 23:44
Check for a command in a shell script. Or outside of it...
#!/usr/bin/env bash
which $command &>/dev/null && echo true || echo false
Domain Kingdom Examples
Bacteria Eubacteria E. coli
Archaea Archaebacter Halophiles
Eukarya Protista fungus-like: slime mold, plant-like: algae, animal-like amoeba
Eukarya Fungi Mushroom
Eukarya Plantae Sunflower
Eukarya Animalia Wolf
@JesseHerrick
JesseHerrick / FixSSH.sh
Created December 30, 2013 21:10
If SSH public key is added, but you still can't log in. Try this on the remote server...
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
@JesseHerrick
JesseHerrick / RBEnvInstall.sh
Created December 26, 2013 19:52
Install RBEnv on OSX/Linux
# Download RBEnv
git clone git://github.com/sstephenson/rbenv.git $HOME/.rbenv
# Find out which shell init file exists.
if [ -f $HOME/.zshrc ]
then
SHELL_INIT="$HOME/.zshrc"
elif [ -f $HOME/.bashrc ]
then
SHELL_INIT="~/.bashrc"