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 | |
set -u | |
set -e | |
#change this below to your actual path. If you another environemnt like staging, fucking change N to -e staging instead. | |
APP_PATH=/youpath/to/app/root | |
PID=$APP_PATH/tmp/pids/unicorn.pid | |
OLD_PID=$APP_PATH/tmp/pids/unicorn.pid.oldbin | |
UNICORN_COMMAND="unicorn_rails -c $APP_PATH/config/unicorn.rb -D" | |
while getopts ":nsNr" opt; do |
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
# If you're getting this error trying to use ApacheBench on OS X Lion: | |
# Benchmarking mwmanning.com (be patient)...apr_socket_recv: Connection reset by peer (54) | |
# | |
# You need to download the latest beta version of Apache and rebuild ab. | |
# Here's how (assuming you have homebrew installed). | |
# Install Homebrew (https://github.com/mxcl/homebrew) and then the Perl Regex support | |
brew install pcre | |
# Download the latest from http://httpd.apache.org/download.cgi, then decompress and compile it |
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/local/bin/macruby | |
framework 'Cocoa' | |
framework 'QuartzCore' | |
class FireworkDelegate | |
attr_accessor :window | |
def initWithURL(url) | |
case url | |
when String | |
@firework_photo_url = NSURL.URLWithString(url) |
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
framework 'Cocoa' | |
class NSColor | |
def toCGColor | |
color_RGB = colorUsingColorSpaceName(NSCalibratedRGBColorSpace) | |
## approach #1 | |
# components = Array.new(4){Pointer.new(:double)} | |
# color_RGB.getRed(components[0], | |
# green: components[1], | |
# blue: components[2], |
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
$(document).ready(function(){ | |
$("a.tab").live('click', function () { | |
$(".content").hide(); | |
$("ul.tabs .active").removeClass("active"); | |
$(this).addClass("active"); | |
$("#" + $(this).attr("title")).show(); | |
}); |
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 'prawn' | |
Prawn::Document.generate('crop-marks.pdf') do | |
spacing = 12 | |
margin = 100 | |
canvas do | |
# topleft corner | |
stroke_line [bounds.left + spacing, bounds.top - margin], | |
[bounds.left + margin - spacing, bounds.top - margin] |
NewerOlder