Start server on Linode
taps server postgres://[DB_USER]:[DB_PASSWORD]@localhost/[DB_NAME] [USER_NAME] [USER_PASSWORD]
where:
- DB_USER is the name of the user for the database we want to pull from.
- DB_PASSWORD is the password of that user.
cat lib/tasks/* | perl -n -e 'print if /[^\x00-\x7F]/' |
Start server on Linode
taps server postgres://[DB_USER]:[DB_PASSWORD]@localhost/[DB_NAME] [USER_NAME] [USER_PASSWORD]
where:
vim $(grep -rl something ./app) | |
# The -l (for "Lima") flag ensures that grep returns only the matching file names. | |
# Page through results in Vim with `:n`. | |
vim $(ack -l something ./app | xargs) | |
# The -l (for "Lima") flag does the same thing as for grep. | |
# We need `xargs` to flatten the list of filenames. |
curl -o latest.dump `heroku pgbackups:url -r production`
[username]
and [database_name]
can be found in the database.yml
file.pg_restore --verbose --clean --no-acl --no-owner -h localhost -U [username] -d [database_name] latest.dump
#!/bin/sh | |
# Change a list of file names to lowercase | |
# | |
# Example: | |
# | |
# lowercase UPPercase.PNG | |
# => uppercase.png | |
for i in * |
// Service for checking the availability of a given word | |
Splitter.module('Checkers', function(Checkers, Splitter) { | |
var LocalChecker = { | |
comKeyFor: function(compound) { | |
return 'avail/.com/' + compound; | |
}, | |
check: function(compound) { |
rails g model User name:index email:uniq token:string{6} age:integer
name:index
creates an indexed column called name
.email:uniq
creates column called email
with a unique index.token:string{6}
constrains the length of token
to 6 chars.class CreateUsers < ActiveRecord::Migration
# get apache to tell you where the errors are in your config | |
sudo apachectl configtest |