answer derived from: http://railscasts.com/episodes/241-simple-omniauth-revised?view=comments
- check comment reply from
Kori Roys
vim ~/.bash_profile
export TWITTER_KEY=your_twitter_key
export TWITTER_SECRET=your_twitter_secret
/* Slow Method */ | |
SHOW COLUMNS FROM table_name; | |
/* Fast Method */ | |
DESC table_name; |
INSERT INTO table_name (column_name1, column_name2, etc) | |
VALUES | |
('value1','value2','etc'); |
# http://stackoverflow.com/a/14114909/1180523 | |
:filetype indent on | |
:set filetype=html # abbrev - :set ft=html | |
:set smartindent # abbrev - :set si | |
# Then gg=G | |
# In my experience this doesn't ALWAYS work (like it should)... but sometimes it does. |
Kori Roys
vim ~/.bash_profile
export TWITTER_KEY=your_twitter_key
export TWITTER_SECRET=your_twitter_secret
$ rails c
> ModelName.delete_all
> ActiveRecord::Base.connection.execute("DELETE from sqlite_sequence where name = 'table_name'")
flash[:error] = "#{@post.errors.full_messages.to_sentence}"
At Crush + Lovely, we use Railsmachine's Moonshine to automate the configuration of our servers. When writing our deployment recipes, VMWare Fusion's ability to take snapshots and rollback to these snapshots is a huge timesaver because it takes just seconds to roll a server image to it's original state.
When you're just configuring a single server, having a static IP address for your server image isn't too important, but when you're configuring multi-server setups, it can be useful to duplicate a number of server images and give each a static IP address so you can consistently deploy to them. While not documented well at all, it turns out that this is relatively easy to accomplish in four simple steps.
Let's say you have a guest machine with the name ubuntu-lucid-lynx-base
/* http://www.smashingmagazine.com/2013/08/09/absolute-horizontal-vertical-centering-css/ */ | |
.Absolute-Center { | |
height: 500px; | |
margin: auto; | |
position: absolute; | |
top: 0; left: 0; bottom: 0; right: 0; | |
} |
#!/bin/bash | |
NOWDATE=`date +%Y-%m-%d` | |
BACKUPNAME="$NOWDATE.sql.gz" | |
echo "Creating backup of database finances to $BACKUPNAME" | |
mysqldump --user=[username] --password=[password] [database] | gzip -9 > $BACKUPNAME | |
echo "Succesfully created database backup" | |
echo "Uploading backup to Amazon S3 bucket…" |
# Install Git and Ruby
$ sudo apt-get install git ruby
# Install Node v5 (or higher)
(https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions)
$ curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
$ sudo apt-get install -y nodejs build-essential