Skip to content

Instantly share code, notes, and snippets.

@remear
remear / eunic
Created February 9, 2012 23:10 — forked from pjammer/eunic
i put this into /usr/local/bin/eunic and you can your server using eunic -s && eunic -N
#!/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
@remear
remear / gist:1724911
Created February 2, 2012 18:09 — forked from akitaonrails/gist:1724673
Fixing Apachebench on OS X Lion
# 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
@remear
remear / gist:1672746
Created January 24, 2012 21:13 — forked from seanlilmateus/gist:1536136
macruby core animation Fireworks, have a nice macruby new year
#!/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)
@remear
remear / face_detector.rb
Created December 7, 2011 22:16 — forked from mattetti/face_detector.rb
Macruby Face Detection in Mac OS X Lion. Usage: $ macruby face_detector.rb or $ macruby face_detector.rb image_url
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],
$(document).ready(function(){
$("a.tab").live('click', function () {
$(".content").hide();
$("ul.tabs .active").removeClass("active");
$(this).addClass("active");
$("#" + $(this).attr("title")).show();
});
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]