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
ec2-authorize default -p 2003 |
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
PROJECTS=$HOME/work/rails/* | |
for p in $PROJECTS; do | |
PROJECT=${p##*/} | |
alias $PROJECT="cd $p" | |
done | |
GEMS=$HOME/work/gems/* | |
for g in $GEMS; do | |
GEM=${g##*/} | |
alias $GEM="cd $g" |
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
Original Source: https://github.com/chneukirchen/styleguide | |
= Christian Neukirchen's Ruby Style Guide | |
You may not like all rules presented here, but they work very well for | |
me and have helped producing high quality code. Everyone is free to | |
code however they want, write and follow their own style guides, but | |
when you contribute to my code, please follow these rules: | |
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
audio/webm weba | |
video/webm webm | |
video/ogg ogm | |
video/ogg ogv | |
video/ogg ogg |
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
# Load application configuration | |
require 'ostruct' | |
require 'yaml' | |
config_path = File.expand_path('config/settings.yml', Rails.root) | |
begin | |
config = YAML.load_file(config_path) | |
rescue Errno::ENOENT | |
raise "Make sure the settings file #{config_path} exists." |
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
var location; | |
var gotPosition = function (currentLocation) { | |
console.log(location.longitude); | |
// currentLocation will be the most up to date | |
// location will always have a value incase, but may not be the most up to date | |
// process with whatever you need to do, update interface, etc. | |
} | |
Titanium.Geolocation.getCurrentPosition(function(e){ | |
Ti.API.info("received geo response"); |
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
railsrc_path = File.expand_path('~/.railsrc') | |
if (ENV['RAILS_ENV'] || defined?(Rails)) && File.exist?(railsrc_path) | |
begin | |
load railsrc_path | |
rescue Exception | |
warn "Could not load: #{railsrc_path}" | |
end | |
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
mysql_query("SELECT Events.* FROM Events INNER JOIN Artists ON Artists.id = Events.artist_id WHERE LOWER(Artists.name) = 'green day'") |
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
var dt = $('.form dt'); | |
if (dt.parents('fieldset').size() == 0) { | |
dt.css('width', maxLabelWidth + 'px'); | |
var ddWidth = $('.form').width() - 45 - maxLabelWidth; | |
$('.form dd').css('width', ddWidth+'px'); | |
$('.form dd input').css('max-width', ddWidth+'px'); | |
} |
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/sh | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the nginx web server | |
# Description: starts nginx using start-stop-daemon |