Skip to content

Instantly share code, notes, and snippets.

View soffes's full-sized avatar

Sam Soffes soffes

View GitHub Profile
@soffes
soffes / nginx
Created July 8, 2009 20:00 — forked from kmorey/nginx
#!/bin/bash
#chkconfig: 2345 80 05
#description: Nginx
. /etc/rc.d/init.d/functions
INITLOG_ARGS=""
nginx=/usr/local/nginx/sbin/nginx
prog=nginx
+ (BOOL)isConnectedToNetwork {
// Recover reachability flags
SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(kCFAllocatorSystemDefault, [@"twitter.com" UTF8String]);
SCNetworkReachabilityFlags flags;
BOOL didRetrieveFlags = SCNetworkReachabilityGetFlags(reachability, &flags);
CFRelease(reachability);
if (!didRetrieveFlags) {
ActionView::Helpers::AssetTagHelper.register_javascript_expansion :jquery => ["http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"]
ActionView::Helpers::AssetTagHelper.register_javascript_expansion :jquery_ui => ["http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"]
ActionView::Helpers::AssetTagHelper.register_javascript_expansion :mootools => ["http://ajax.googleapis.com/ajax/libs/mootools/1.2.3/mootools-yui-compressed.js"]
ActionView::Helpers::AssetTagHelper.register_javascript_expansion :prototype => ["http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.3/prototype.js"]
ActionView::Helpers::AssetTagHelper.register_javascript_expansion :scriptaculous => ["http://ajax.googleapis.com/ajax/libs/scriptaculous/1.8.2/scriptaculous.js"]
ActionView::Helpers::AssetTagHelper.register_javascript_expansion :dojo => ["http://ajax.googleapis.com/ajax/libs/dojo/1.3.2/dojo/dojo.xd.js"]
ActionView::Helpers::AssetTagHelper.register_javascript_expansion :swfobject => ["http://ajax.googleapis.co
module LayoutHelper
def title(page_title, show_title = true)
@content_for_title = page_title.to_s
@show_title = show_title
end
def show_title?
@show_title
end
// Simple reset
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, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td
margin: 0
padding: 0
border: 0
outline: 0
font-weight: inherit
font-style: inherit
font-size: 100%
user nginx;
worker_processes 5;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
@soffes
soffes / gist:170199
Created August 19, 2009 06:04
sample nginx conf
server {
listen 80;
server_name example.com;
root /var/www/example.com/current/public;
passenger_enabled on;
location ~ "/{javascripts|stylesheets|images}/" {
expires 31d;
}
}
ADT - America/Halifax - -10800
CEST - Europe/Paris - 7200
CDT - America/Chicago - -18000
CDT - America/Chicago - -18000
JST - Asia/Tokyo - 32400
WEST - Europe/Lisbon - 3600
MSD - Europe/Moscow - 14400
EEST - Europe/Istanbul - 10800
GST - Asia/Dubai - 14400
COT - America/Bogota - -18000
export TERM=xterm-color
export GREP_OPTIONS='--color=auto' GREP_COLOR='1;32'
export CLICOLOR=1
alias ls='ls -G'
export COLOR_NC='e[0m' # No Color
export COLOR_WHITE='e[1;37m'
export COLOR_BLACK='e[0;30m'
export COLOR_BLUE='e[0;34m'
export COLOR_LIGHT_BLUE='e[1;34m'
export COLOR_GREEN='e[0;32m'
#!/bin/sh
# Install ImageMagick on Snow Leopard: by kain, improved by mislav and samsoffes
# http://www.icoretech.org/2009/08/install-imagemagick-in-leopard-snow-leopard/
# Work with 64bit kernel mode
set -e
PREFIX=/usr/local
# Passenger users: amend your Apache global configuration with the following directive
# SetEnv PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin