This file contains 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 AttachedFile < ActiveRecord::Base | |
belongs_to :attachable, :polymorphic => true | |
attr_accessible :file, :plan_id | |
validates :file, :presence => true | |
mount_uploader :file do | |
def store_dir | |
"uploads/#{model.attachable_type.downcase.pluralize}" | |
end | |
end |
This file contains 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
Started GET "/en/advisor/offers/10,associate-accountant-krakow-hitachi" for 77.252.243.105 at 2011-11-16 14:39:38 +0100 | |
Processing by Advisor::OffersController#show as HTML | |
Parameters: {"id"=>"10,associate-accountant-krakow-hitachi", "locale"=>"en"} | |
User Load (0.4ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 2 LIMIT 1 | |
Role Load (0.3ms) SELECT `roles`.* FROM `roles` INNER JOIN `roles_users` ON `roles`.id = `roles_users`.role_id WHERE ((`roles_users`.user_id = 2)) | |
Offer Load (0.3ms) SELECT `offers`.* FROM `offers` WHERE `offers`.`id` = 10 LIMIT 1 | |
Company Load (0.2ms) SELECT `companies`.* FROM `companies` WHERE `companies`.`id` = 175 LIMIT 1 | |
FacebookUser Load (0.2ms) SELECT `facebook_users`.* FROM `facebook_users` WHERE (`facebook_users`.user_id = 2) LIMIT 1 | |
SQL (0.2ms) SELECT COUNT(*) FROM `offers` WHERE (`offers`.company_id = 175) | |
SQL (0.1ms) BEGIN |
This file contains 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
$ cd /usr/src | |
$ wget http://nginx.org/download/nginx-0.8.52.tar.gz | |
$ tar xzvf ./nginx-0.8.52.tar.gz | |
$ rm ./nginx-0.8.52.tar.gz | |
$ gem install s3sync capistrano capistrano-ext passenger --no-ri --no-rdoc | |
$ passenger-install-nginx-module | |
# Automatically download and install Nginx? 2. No: I want to customize my Nginx installation | |
# Where is your Nginx source code located?: /usr/src/nginx-0.8.52 | |
# Where do you want to install Nginx to?: /opt/nginx |
This file contains 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/bash | |
# NGINX RC.D SCRIPT | |
# Archlinux | |
NGINX_CONFIG="/opt/nginx/conf/nginx.conf" | |
NGINX_BIN="/opt/nginx/sbin/" | |
#. /etc/conf.d/nginx | |
. /etc/rc.conf | |
. /etc/rc.d/functions |
This file contains 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
function parse_git_branch { | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || return | |
echo "("${ref#refs/heads/}")" | |
} | |
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[0;33m\]" | |
GREEN="\[\033[0;32m\]" | |
PS1="\H$GREEN{$RED\W$GREEN}-$GREEN{$RED\$(parse_git_branch)$GREEN}-$YELLOW{$GREEN\$(date +%H:%M)$YELLOW}\n$GREEN$ " |
NewerOlder