- The Basics
- Outline:
- Learn to create a new Rails project to keep track of your Starship Fleet. (You have a Fleet, right?)
- Outline:
- Some good, clean, DRY code
- Coming next time...
- Making our Tracker actually useful
- Coming next time...
- Layouts, Mailers, and Looking good while we work
#!/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…" |
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://stackoverflow.com/a/808776/1180523
# model
validates :email, :uniqueness => { message: "is wrong" }
validates :name, :uniqueness => { message: "Your name is wrong" }
HUMANIZED_ATTRIBUTES = {
:email => "E-mail address",
:name => "" # don't include column name in error
flash[:error] = "#{@post.errors.full_messages.to_sentence}"
sudo npm install -g localtunnel
lt --port
https://github.com/dnschneid/crouton/wiki/Running-servers-in-crouton
$ rails c
> ModelName.delete_all
> ActiveRecord::Base.connection.execute("DELETE from sqlite_sequence where name = 'table_name'")
/* 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; | |
} |
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
http://www.wyliethomas.com/blog/2014/04/12/chromebook-for-web-development/
####(This wipes all the memory, so backup anything local)
esc + refresh then tap power