- Drops the f-bomb (or says "shit")
- Makes fun of Java (or Struts, Hibernate, etc)
- Mentions "frameworks should be extractions, not inventions"
- Mentions "constraints are liberating"
- Defends TurboLinks or the asset pipeline
- Mentions Basecamp
10001 | |
1002001 1004006004002 | |
14541 102030301 | |
44944 1022325232202 | |
1000001999901 1211124711121 | |
2617287827163 4000008000005 | |
1 101 | |
1022325232201 1213326733121 | |
44943 12345654321 | |
42874 103045301 |
$ ActiveRecord::Base.connection.reset_pk_sequence!('table_name')
If you need the table names:
$ ActiveRecord::Base.connection.tables
=> ["accounts", "assets", ...]
#!/usr/bin/env ruby | |
# encoding: UTF-8 | |
# Convert FLAC files to mp3 files, keeping metadata from the FLAC files. | |
# | |
# Requires that FLAC (including metaflac) and LAME tools be installed | |
# and on the path. | |
# | |
# Takes any number of .flac files on the command line. |
require 'mina/bundler' | |
require 'mina/rails' | |
require 'mina/git' | |
require 'mina/rbenv' # for rbenv support. (http://rbenv.org) | |
# require 'mina/rvm' # for rvm support. (http://rvm.io) | |
# Basic settings: | |
# domain - The hostname to SSH to. | |
# deploy_to - Path to deploy into. | |
# repository - Git repo to clone from. (needed by mina/git) |
source :rubygems | |
gem "puma" | |
gem "sinatra" |
If you're writing web applications with Ruby there comes a time when you might need something a lot simpler, or even faster, than Ruby on Rails or the Sinatra micro-framework. Enter Rack.
Rack describes itself as follows:
Rack provides a minimal interface between webservers supporting Ruby and Ruby frameworks.
Before Rack came along Ruby web frameworks all implemented their own interfaces, which made it incredibly difficult to write web servers for them, or to share code between two different frameworks. Now almost all Ruby web frameworks implement Rack, including Rails and Sinatra, meaning that these applications can now behave in a similar fashion to one another.
At it's core Rack provides a great set of tools to allow you to build the most simple web application or interface you can. Rack applications can be written in a single line of code. But we're getting ahead of ourselves a bit.
/Library/PostgreSQL/9.1/bin/pg_dump --host localhost --port 5432 --username <USERNAME> -b -c -E UTF-8 --no-owner --no-privileges --no-tablespaces --clean --schema public -F c -Z 9 -f <BACKUPFILENAME> <DATABASENAME> | |
/Library/PostgreSQL/9.1/bin/pg_restore --host localhost --port 5432 --username <USERNAME> --dbname <DATABASENAME> --no-owner --no-privileges --no-tablespaces --clean --schema public "<BACKUPFILENAME>" |
This was all done on a rather nice iMac:
- Intel Core i7 Sandy-Bridge 4-core chip
- 12 GB of RAM
- 1TB Spinning-disk hard drive
- java version 1.6.0_37, build 1.6.0_37-b06-434-11M3909 "HotSpot" 64-bit VM "mixed mode" (whatever that's supposed to mean)
- The excellent pre-chewed testing app at
require 'bundler/capistrano' | |
set :application, "net" | |
set :repository, "git@githost.com:net.git" | |
set :scm, :git | |
set :default_environment, { | |
'PATH' => "$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH" | |
} |