apt-get -y update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties vim mc ImageMagick
# nginx
add-apt-repository ppa:nginx/stable
apt-get -y update
apt-get -y install nginx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bin/rake db:{drop,create,migrate} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ember.Test.registerHelper('selectFrom', | |
function(app, selector, value, description) { | |
// choose an option | |
find(selector).val(value); | |
// trigger the change | |
find(selector).change(); | |
// assert the selected option | |
equal(find(selector+" option:selected").val(), value, description||"makes the selection"); | |
// promise | |
return wait(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set up secret_key_base for current environment in config/secrets.yml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Admin::SizesController < Admin::AdminController | |
include OrderableController | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unless Rails.env.production? | |
connection = ActiveRecord::Base.connection | |
connection.tables.each do |table| | |
connection.execute("TRUNCATE #{table}") unless table == "schema_migrations" | |
end | |
sql = File.read('db/import.sql') | |
statements = sql.split(/;$/) | |
statements.pop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install vsftpd | |
sudo vim /etc/vsftpd.conf | |
# Uncomment #local_umask=022 | |
sudo service vsftpd restart |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
str = "number 5" | |
str.gsub(/number\ (\d+)/, '#\1') | |
# => "#5" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo service nginx configtest | |
* Testing nginx configuration [fail] | |
sudo nginx -t | |
nginx: [emerg] could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32 | |
nginx: configuration file /etc/nginx/nginx.conf test failed | |
server_names_hash_bucket_size = 64 | |
sudo service nginx restart |