Skip to content

Instantly share code, notes, and snippets.

View JesseHerrick's full-sized avatar

Jesse Herrick JesseHerrick

View GitHub Profile
@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!'
---
---
// other styles
Drink Caffeine (mg/fl.oz.)
Brewed Coffee 20.375
Espresso 51.33
Dr. Pepper 3.42
@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
@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 / reset.css
Created August 8, 2014 03:12
Proper reset CSS.
/**
* Eric Meyer's Reset CSS v2.0 (http://meyerweb.com/eric/tools/css/reset/)
* http://cssreset.com
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
@JesseHerrick
JesseHerrick / breakpoints.scss
Created August 8, 2014 04:37
My SCSS breakpoints.
// responsiveness
@mixin breakpoint($point) {
@if $point == morbidly-obese-bear {
@media (min-width: 1601px) { @content; }
}
@if $point == papa-bear {
@media (max-width: 1600px) { @content; }
}
@else if $point == mama-bear {
@media (max-width: 1250px) { @content; }
@JesseHerrick
JesseHerrick / disk-transfer.txt
Last active August 10, 2016 13:21
Transfer disk image to drive with PROGRESS!
pv -tpreb ~/path/to/foo.img | sudo dd of=/dev/rdisk2 bs=1m

Keybase proof

I hereby claim:

  • I am jesseherrick on github.
  • I am jesseherrick (https://keybase.io/jesseherrick) on keybase.
  • I have a public key whose fingerprint is 28E9 77CE AB9B D9D4 929A 60F5 CC7B F739 4445 BE75

To claim this, I am signing this object:

@JesseHerrick
JesseHerrick / nginx-user-hosting.conf
Created October 11, 2014 14:24
Nginx user hosting.
location ~ ^/(.+?)(/.*)?$ {
alias /home/$1/www$2;
index index.html;
autoindex on;
}