FridayHug.com http://fridayhug.com
The Smallest Rails App http://thesmallestrailsapp.com
%w(action_controller/railtie coderay).each &method(:require)| test: | |
| override: | |
| - bundle exec rspec spec | |
| deployment: | |
| acceptance: | |
| branch: master | |
| commands: | |
| - ./script/heroku_deploy.sh <ACCEPTANCE_HEROKU_APP>: | |
| timeout: 300 |
FridayHug.com http://fridayhug.com
The Smallest Rails App http://thesmallestrailsapp.com
%w(action_controller/railtie coderay).each &method(:require)| #!/usr/bin/env bash | |
| curl https://s3.amazonaws.com/heroku-jvm-buildpack-vi/vim-7.3.tar.gz --output vim.tar.gz | |
| mkdir vim && tar xzvf vim.tar.gz -C vim | |
| export PATH=$PATH:/app/vim/bin |
| /* How to calculate postgreSQL database size in disk ? */ | |
| SELECT pg_size_pretty(pg_database_size('thedbname')); | |
| /* Calculate size of a table including or excluding the index */ | |
| SELECT pg_size_pretty(pg_total_relation_size('big_table')); | |
| SELECT pg_size_pretty(pg_relation_size('big_table')); /* without index */ | |
| /* See indexes on a table with `\d tablename` */ |
| #!/bin/sh | |
| filename=$1 | |
| echo "Begin processing file:" $filename | |
| dimensions=$(identify -format '%w %h' $filename) | |
| IFS=' ' read -a array <<< "$dimensions" | |
| width=${array[0]} | |
| height=${array[1]} |
| # Update, upgrade and install development tools: | |
| apt-get update | |
| apt-get -y upgrade | |
| apt-get -y install build-essential | |
| apt-get -y install git-core | |
| # Install rbenv | |
| git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv | |
| # Add rbenv to the path: |
| # ....other stuff here | |
| paginate: 10 |
| # Author: Pieter Noordhuis | |
| # Description: Simple demo to showcase Redis PubSub with EventMachine | |
| # | |
| # Update 7 Oct 2010: | |
| # - This example does *not* appear to work with Chrome >=6.0. Apparently, | |
| # the WebSocket protocol implementation in the cramp gem does not work | |
| # well with Chrome's (newer) WebSocket implementation. | |
| # | |
| # Requirements: | |
| # - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby |
| ENV["PATH"] = "/opt/ruby/bin:#{ENV['PATH']}" | |
| ENV["RAILS_ENV"] = "production" | |
| ENV["QUEUE"] = "*" | |
| Bluepill.application("nichelator") do |app| | |
| app.working_dir = "/var/apps/nichelator/current" | |
| app.uid = "app" | |
| app.gid = "app" | |
| 2.times do |i| | |
| app.process("resque-#{i}") do |process| |