- expiration - TTL in milliseconds
# TTL = 5 sec
exchange.publish(msg_data.to_json, :routing_key => msg_key, :expiration => 5*1000)
# find all occurrences of $name in the string | |
formula = "$paramname > $value && $x>0" | |
s = formula.gsub(/\$([a-z_\d]+)/) do | |
name = $1 | |
if name=='now' | |
v = Time.now.utc.now | |
else |
CREATE TABLE IF NOT EXISTS `projects` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ; | |
CREATE TABLE IF NOT EXISTS `tasks` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`project_id` int(11) NOT NULL, | |
`title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, |
# specific version of Rails, with MySQL database | |
rails _VERSION_ new myapp -d mysql | |
examples: | |
rails _3.2.16_ new myapp -d mysql |
*/10 * * * * /bin/bash -l -c 'cd /var/www/apps/appname/current/ && RAILS_ENV=production bundle exec rake sessions:cleanup >> /var/www/logs/cron.log ' |
# reset branch | |
git checkout production | |
git reset --hard origin/master |
#!/bin/sh | |
echo | |
echo "**** get changes for TEST App" | |
echo | |
cd /var/www/html/testapp || exit | |
unset GIT_DIR | |
git pull origin master | |
Copy views: