http://xquartz.macosforge.org/landing/
brew update
brew tap homebrew/dupes
brew install autoconf automake apple-gcc42
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'mysql' | |
require 'net/ssh/gateway' | |
HOST = '' | |
SSH_USER = '' | |
SSH_PASS = '' | |
DB_HOST = "127.0.0.1" | |
DB_USER = "" |
http://xquartz.macosforge.org/landing/
brew update
brew tap homebrew/dupes
brew install autoconf automake apple-gcc42
$ cat somefile.txt | ruby version*.rb
Version 1:
input = $stdin.read
input.each_line do |line|
...
end
Version 2:
$ ActiveRecord::Base.connection.reset_pk_sequence!('table_name')
If you need the table names:
$ ActiveRecord::Base.connection.tables
=> ["accounts", "assets", ...]
index = 0 | |
loop do | |
failure = Resque::Failure.all(index) | |
break if failure.nil? | |
if failure["queue"] == "queue_name" | |
Resque::Failure.requeue(index) | |
Resque::Failure.remove(index) |
/^(?=.*\d)(?=.*?[a-z])(?=.*?[A-Z]).{8,40}$/ |
page.response_headers['Content-Type'].should == "text/csv"
page.response_headers['Content-Disposition'].should == "attachment; filename=\"some_file.csv\""
find("a.some_link")["href"].should == "http://google.com"
// swap the keybindings for paste and paste_and_indent | |
{ "keys": ["super+v"], "command": "paste_and_indent" }, | |
{ "keys": ["super+shift+v"], "command": "paste" } |
class AppController < UIViewController | |
def loadView | |
self.view = AppView.alloc.init | |
end | |
def viewDidLoad | |
super | |
view.viewDidLoad | |
end |
Create rvmrc file:
$ rvm use 1.9.3@yourgemsetname --create --rvmrc
Add bundler to your Rakefile
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project'
require 'bundler'
Bundler.require