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
| typeset -F SECONDS=0 | |
| export START_TIME=$SECONDS | |
| if [ -e ~/.profiling ]; then | |
| echo "zshrc started" | |
| source() { | |
| local before=$SECONDS | |
| . $* | |
| local duration=$((($SECONDS - $before) * 1000)) |
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
| #!/bin/bash | |
| # Open current directory in forklift | |
| echo -n $PWD | pbcopy | |
| (cat<<EOF | |
| tell application "Forklift" | |
| activate | |
| tell application "System Events" |
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
| server { | |
| listen 80; | |
| server_name subdomain.domain.com; | |
| location ~* ^/(favicon.ico|robots.txt|500.html|404.html|422.html)$ { | |
| root /home/rails/website/current/public; | |
| try_files $uri =404; | |
| } | |
| } |
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
| SCRIPT_DIR=`dirname ${BASH_SOURCE[0]-$0}` | |
| SCRIPT_DIR=`cd $SCRIPT_DIR && pwd` |
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
| @mixin retina-image($image) { | |
| background-image: url(image-path("#{$image}.png")); | |
| @media (-webkit-min-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-device-pixel-ratio: 1.5) { | |
| background-image: url(image-path("#{$image}@2x.png")); | |
| } | |
| } | |
| @mixin retina-inline-image($image) { | |
| background-image: inline-image("#{$image}.png"); | |
| @media (-webkit-min-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-device-pixel-ratio: 1.5) { |
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
| //= require components/rivets/lib/rivets | |
| // ---------------------------------- | |
| attributes: {}, | |
| set: function (key, value) { | |
| if (this.attributes[key] !== value) { | |
| this.attributes[key] = value; | |
| this.events.triggerEvent("change:" + key, {key: key, value: value}); | |
| } |
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
| #!/bin/bash | |
| # uses memstats.rb from https://gist.github.com/elentok/5412060 | |
| master_pid=`ps aux | grep 'unicorn master' | grep -v 'grep' | awk '{print $2}'` | |
| worker_pids=`ps aux | grep 'unicorn worker' | grep -v 'grep' | awk '{print $2}'` | |
| stats() { | |
| ./memstats.rb $1 | grep -E '(rss|percentage)' | |
| } |
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/env ruby | |
| #------------------------------------------------------------------------------ | |
| # Aggregate Print useful information from /proc/[pid]/smaps | |
| # | |
| # pss - Roughly the amount of memory that is "really" being used by the pid | |
| # swap - Amount of swap this process is currently using | |
| # | |
| # Reference: | |
| # http://www.mjmwired.net/kernel/Documentation/filesystems/proc.txt#361 |
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
| #!/bin/zsh | |
| get_gems() { | |
| cat Gemfile | | |
| sed 's/^ *//' | | |
| sed -E '/^(group|end|source|#)/d' | | |
| sed '/^ *$/d' | | |
| sed "s/^gem ['\"]//" | | |
| sed "s/['\"].*$//" | |
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
| tell application "8tracks" | |
| activate | |
| tell application "System Events" | |
| keystroke " " | |
| keystroke tab using {command down} | |
| end tell | |
| end tell |