Skip to content

Instantly share code, notes, and snippets.

View JesseHerrick's full-sized avatar

Jesse Herrick JesseHerrick

View GitHub Profile
@JesseHerrick
JesseHerrick / nearEnd.js
Created August 1, 2014 17:27
Checks if you're near the end of a page with a pixel threshold.
// returns true or false if near the bottom of a page
var nearEnd = function(threshold) {
return $(window).scrollTop() + $(window).height() + threshold >= $(document).height()
}
@JesseHerrick
JesseHerrick / osascript.rb
Last active August 29, 2015 14:04 — forked from dinge/gist:6983008
Call AppleScript from Ruby.
def osascript(script)
system 'osascript', *script.split(/\n/).map { |line| ['-e', line] }.flatten
end
osascript <<-END
tell application "Finder"
display dialog "Hello"
end tell
END
Drink Caffeine (mg/fl.oz.)
Brewed Coffee 20.375
Espresso 51.33
Dr. Pepper 3.42
---
---
// other styles
@JesseHerrick
JesseHerrick / build.sh
Last active August 29, 2015 14:04
Simple GitHub Pages-like deployment to a custom server.
#!/usr/bin/env bash
cd /home/web/site_orig
git pull origin 4.0
echo 'Building Jekyll site.'
bundle install && rake build
rm -rf /home/web/site/*
cp -r _site/* /home/web/site/
echo 'Done!'
@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]'
@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 / colors.less
Last active August 29, 2015 14:02
Color rainbow!
// red
@red: #ee3f35;
// orange
@orange: #f6921c;
// yellow
@yellow: #e9c800;
// green
@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
{
"postData": {
"title": "Post Title",
"date": "2014-05-01"
}
}