Skip to content

Instantly share code, notes, and snippets.

View JesseHerrick's full-sized avatar

Jesse Herrick JesseHerrick

View GitHub Profile
#!/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
# file: rest-server.rb
require 'sinatra'
# all status codes given are based on W3C standards
get '/' do
'Here is some data.'
end
post '/' do

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

@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");
}
@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",
{
"postData": {
"title": "Post Title",
"date": "2014-05-01"
}
}
@JesseHerrick
JesseHerrick / website-rsync.sh
Created June 8, 2014 17:44
My rsync push command.
rsync -crzi --delete ./_site/ ubuntu@webserver:~/site/
# -c (checksum) - ensures that unchanged files are not pushed
# -r (recursive) - recursive sync
# -z (compress) - compression for speed and conservation of bandwidth
# -i (itemize) - itemized output
# --delete - deletes extraneous files from server
# ./_site/ - local directory to sync
# ubuntu - remote username
# @webserver - webserver location
@JesseHerrick
JesseHerrick / colors.less
Last active August 29, 2015 14:02
Color rainbow!
// red
@red: #ee3f35;
// orange
@orange: #f6921c;
// yellow
@yellow: #e9c800;
// green
@JesseHerrick
JesseHerrick / nginx.conf
Last active August 29, 2015 14:02
jesseherrick.io nginx configuration
user www www;
worker_processes 2;
events {
worker_connections 2000;
}
http {
gzip on;
gzip_types
@JesseHerrick
JesseHerrick / .muttrc
Created July 10, 2014 22:08
My muttrc file for gmail.
# Credentials
set imap_user = '[email protected]'
set imap_pass = 'GMAIL_PASSWORD'
# Servers
set smtp_url = 'smtp://[email protected]:587'
set smtp_pass = 'GMAIL_PASSWORD'
# Meta
set from = '[email protected]'