(from a scratch install). Kinda, I imported my user home (~) from a Time Machine backup.
sudo mkdir /usr/local
sudo chown -R `whoami` /usr/local
curl -L http://github.com/mxcl/homebrew/tarball/master | tar xz --strip 1 -C /usr/local
$source = 'http://gemcutter.org/' | |
gem 'will_paginate', :lib => 'will_paginate', :source => $source | |
gem 'annotate', :lib => 'annotate', :source => $source | |
gem 'kete-tiny_mce', :lib => "tiny_mce", :source => $source | |
gem 'paperclip', :lib => "paperclip", :source => $source | |
gem 'searchlogic', :lib => "searchlogic", :source => $source | |
gem 'authlogic', :lib => "authlogic", :source => $source | |
gem 'cancan', :lib => "cancan", :source => $source | |
def interesting_tables | |
ActiveRecord::Base.connection.tables | |
end | |
class BackupDB < ActiveRecord::Base | |
end | |
destination_db = 'new' | |
BackupDB.establish_connection destination_db.intern |
require 'rubygems' | |
require 'active_record' | |
require 'net/http' | |
require 'uri' | |
email = "YOUR_EMAIL_HERE" | |
password = "YOUR_PASSWORD_HERE" | |
ActiveRecord::Base.establish_connection(:adapter => "mysql", :socket => "/tmp/mysql.sock", :user => "root", :password => "root", :database => "YOUR_DATABASE_HERE") | |
results = ActiveRecord::Base.connection.execute("SELECT * FROM `wp_posts` WHERE post_type = 'post' and post_status='publish' order by post_date asc;") |
This example shows how to setup an environment running Rails 3 beta 3 under 1.9.2-head with a 'rails3' gem set. | |
∴ rvm update --head | |
# ((Open a new shell)) or do 'rvm reload' | |
# If you do not already have the ruby interpreter installed, install it: | |
∴ rvm install 1.9.2-head | |
# Switch to 1.9.2-head and gemset rails3, create if it doesn't exist. | |
∴ rvm --create use 1.9.2-head@rails3 |
# include at least one source and the rails gem | |
source :gemcutter | |
gem 'rails', '~> 2.3.5', :require => nil | |
gem 'sqlite3-ruby', :require => 'sqlite3' | |
# Devise 1.0.2 is not a valid gem plugin for Rails, so use git until 1.0.3 | |
# gem 'devise', :git => 'git://github.com/plataformatec/devise.git', :ref => 'v1.0' | |
group :development do | |
# bundler requires these gems in development |
(a gist based on the old toolmantim article on setting up remote repos)
To collaborate in a distributed development process you’ll need to push code to remotely accessible repositories.
This is somewhat of a follow-up to the previous article setting up a new rails app with git.
Set up the new bare repo on the server:
#!/bin/sh | |
# Reference | |
# http://superuser.com/questions/199570/warnings-errors-with-emacs-cocoa-23-2-on-osx-terminal | |
EMACS_PATH=/Applications/Emacs.app/Contents/MacOS/Emacs | |
if [ $(id -u) = "0" ]; then | |
sudo $EMACS_PATH $* & | |
else |
switch(node){ | |
case 1: | |
... | |
break; | |
case ...; | |
... | |
break; | |
case 10: | |
node = 1; | |
break; |
#!/usr/bin/env bash | |
for (( i = 0; i < 1000; i++ )); do | |
curl -sL www.submarinoviagens.com.br/planteem1click > /dev/null | |
done |