A Pen by Evan Lovely on CodePen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# Convert a Markdown README to HTML with Github Flavored Markdown | |
# Github and Pygments styles are included in the output | |
# | |
# Requirements: json gem (`gem install json`) | |
# | |
# Input: STDIN or filename | |
# Output: STDOUT | |
# Arguments: "-c" to copy to clipboard (or "| pbcopy"), or "> filename.html" to output to a file | |
# cat README.md | flavor > README.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Play sound Basso upon error | |
on_stylesheet_error do | |
system('afplay /System/Library/Sounds/Basso.aiff') | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# search bash aliases | |
sba() { | |
cat ~/.bash_aliases | grep -i -A 1 "^#.*$*" | |
cat ~/.bash_aliases | grep -i -B 1 "^alias.*$*" | |
cat ~/.bash_functions | grep -i -A 1 "^#.*$*" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Make elements align in a grid, regardless of height | |
// Apply to elements you want as grid items | |
// $cols = how many columns you want | |
// $margin-right = margin-right, should be in percent | |
// $ie8-height = an explicit height for all the elements, "off" by default, only applied to IE | |
@mixin gridify($cols, $margin-right: 5%, $ie8-height: auto) { | |
// Math for widths, margins, and clears | |
$width: (100% / $cols) - $margin-right + ($margin-right / $cols); | |
$ie-width: (100% / $cols) - $margin-right; | |
$clearnum: $cols + 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$aliases['prod'] = array( | |
'root' => '', | |
'uri' => '', | |
'remote-user' => '', | |
'remote-host' => '', | |
'ssh-options' => '-o PasswordAuthentication=yes', | |
'path-aliases' => array( | |
'%files' => 'sites/default/files', | |
), | |
'databases' => |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author: Evan Lovely | |
# Syncs the database and files from the live production site to here. Run it anywhere with `sh sync--prod->stage.sh` | |
# Needs to be an absolute path | |
LOCAL_PATH="" | |
SSH="[email protected]" | |
DB_USER="" | |
DB_PASS="" | |
DB="" | |
REMOTE_PATH="" |
A Pen by Evan Lovely on CodePen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Git Checkout Helper | |
gitco() { | |
git branch | |
echo "Branch to checkout? (Fuzzy searching from left to right with space support)" | |
read branch | |
branches=$(git branch | egrep -i "${branch// /.*}" | tr -d ' ') | |
count=$(echo "$branches" | egrep -c ".") | |
if [ "$count" = "1" ]; then | |
git checkout $(echo $branches | tr -d '\n' | tr -d '*') | |
elif [[ "$count" = "0" ]]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run on an image to see it's width & height in pixels, then copy the CSS syntax for it. | |
imgsize () { | |
width=$(mdls -name kMDItemPixelWidth -raw "$1") | |
height=$(mdls -name kMDItemPixelHeight -raw "$1") | |
echo "width: "$width"px; | |
height: "$height"px;" | pbcopy | |
echo "$width"x"$height" | |
} | |
# Displays all images in a directory with image sizes. Either pass in a folder or run as-is to list the current directory |