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: $local_fs $remote_fs $network $syslog | |
# Required-Stop: $local_fs $remote_fs $network $syslog | |
# 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 |
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
export rvm_project_rvmrc_default=1 | |
export rvm_project_rvmrc=1 | |
[ -f "$HOME/.rvmrc.local" ] && source "$HOME/.rvmrc.local" |
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
+ : 172 > export rvm_trace_flag=1 | |
+ : 172 > rvm_trace_flag=1 | |
+ : 177 > true 1 0 0 0 HOME=/Users/dev | |
+ : 181 > (( rvm_ignore_rvmrc == 0 )) | |
+ : 183 > for rvmrc in /etc/rvmrc '"$HOME/.rvmrc"' | |
+ : 185 > [[ -s /etc/rvmrc ]] | |
+ : 183 > for rvmrc in /etc/rvmrc '"$HOME/.rvmrc"' | |
+ : 185 > [[ -s /Users/dev/.rvmrc ]] | |
+ : 187 > grep '^\s*rvm .*$' /Users/dev/.rvmrc | |
+ : 194 > source /Users/dev/.rvmrc |
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
Last 4 lines of my .bashrc: | |
# RVM | |
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" | |
# RVM Autocomplete | |
[[ -r $rvm_path/scripts/completion ]] && . $rvm_path/scripts/completion | |
Output when I type: rvm install [tab] |
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
gort:~ martinisoft$ rvm install -n 1.9 rbx -- --default-version=1.9rbx-head-1.9 installing #dependencies Pulling from origin master | |
Copying from repo to source... | |
rbx-head-1.9 - #configuring | |
rbx-head-1.9 - #compiling | |
rbx-head-1.9 - adjusting #shebangs for (erb ri rdoc). | |
rbx-head-1.9 - #importing default gemsets (/Users/martinisoft/.rvm/gemsets/) | |
WARN: rbx rbx-1.9-head-1.9 is not installed. | |
To install do: 'rvm install rbx-1.9-head-1.9' | |
gort:~ martinisoft$ rvm list |
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
- any character you use it will literally match it except special characters | |
^ $ ? . / \ [ ] { } ( ) + * - all the special characters that will need escaping if you don't want them to be special | |
// - regexp ruby class | |
Common Patterns (I authored) | |
/[\w+\.~-]+@[\w~-]+.[\w\.]+/ - match emails, conforms to RFC 3986 section 3.3 | |
/\+?(\d)?[-|\.|\s]?\(?(\d{3})\)?[-|\.|\s]?(\d{3})[-|\.|\s]?(\d{4})/ - match phone numbers, https://gist.github.com/1009331 | |
Strategies |
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
run("echo group :test, :development do >> Gemfile;") | |
run("echo gem \\'rspec-rails\\', \\'\\>\\= 2.3.0\\' >> Gemfile;") | |
run("echo gem \\'capybara\\', \\'0.3.9\\' >> Gemfile;") | |
run("echo gem \\'database_cleaner\\' >> Gemfile;") | |
run("echo gem \\'cucumber-rails\\' >> Gemfile;") | |
run("echo gem \\'launchy\\' >> Gemfile;") | |
run("echo end >> Gemfile;") | |
run("bundle install") |
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
## Rails App Template | |
## Updated for Rails 3.0.1 | |
## Created on 10/23/10 | |
## Updated on 11/4/10 | |
## Run using $ rails new [appname] -JT -m tpl-cukeapp.rb | |
## Gems | |
# Warden and Devise for security | |
gem 'warden', '0.10.7' |
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
# Rails 3 jQuery Install Rakefile | |
# by Aaron Kalin | |
# Compiled from http://www.railsinside.com/tips/451-howto-unobtrusive-javascript-with-rails-3.html | |
# | |
# Note: this assumes you use git, if not then use the optional usage | |
# | |
# Usage: rake install_query | |
# | |
# Optional usage: rake install_jquery[nogit] | |
# |
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 'eventmachine' | |
module EventMachine | |
module Protocols | |
class SRCDS < Connection | |
include EventMachine::Deferrable | |
def initialize | |
@authed = false | |
@commands = { "exec" => 2, "auth" => 3 } |