dokku 0.6.5
Create a droplet (can be a basic $5 one) and add a SSH key.
Access the droplet ip and finish the basic Dokku setup, basically it's used to setup a domain and add the SSH key to the dokku
user.
/* Border & Vignette Setup */ | |
figure{ | |
position: relative; | |
display: block; | |
line-height: 0; | |
width: 500px; | |
height: 333px; | |
margin-bottom: 2em; | |
border: 1em solid #fff; |
#!/usr/bin/env ruby | |
# Validates that you don't commit forbidden keywords to the repo | |
# You can skip this checking with 'git commit --no-verify' | |
exit 0 if ARGV.include?('--no-verify') | |
# Update this list with your own forbidden keywords | |
KEYWORDS = %w(binding.pry console.log debugger) | |
def red(text) "\033[31m#{text}\033[0m"; end |
class ImportLegacyDevices < ActiveRecord::Migration | |
def self.up | |
return unless Rails.env.production? | |
legacy_devices.each do |device_id, issue| | |
if device = Device.find_by_hardware_id(device_id) | |
unless InclusiveIssue.exists?(:issue_id => issue.id, :device_id => device.id) | |
InclusiveIssue.create!( | |
:issue => issue, | |
:device => device, |
#!/bin/bash | |
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/ | |
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server | |
############################################### | |
# To use: | |
# wget https://gist.githubusercontent.com/four43/e00d01ca084c5972f229/raw/install-redis.sh | |
# chmod 777 install-redis.sh | |
# ./install-redis.sh | |
############################################### | |
echo "*****************************************" |
#!/bin/bash | |
# echoes '#!/bin/bash xdg-open "$1" &> $HOME/.xdg-open-error &' to /usr/sbin/open | |
echo -e "\043\041/bin/bash\n\nxdg-open \042\044\061\042 &> $HOME/.xdg-open-error &" > ozanmuyes-open | |
sudo mv ozanmuyes-open /usr/sbin/open | |
sudo chmod +x /usr/sbin/open | |
echo -e "\n# Mac OSX \047open\047 equivalent for Debian\nalias 'open'='/usr/sbin/open'" >> $HOME/.bashrc | |
. $HOME/.bashrc |
Taken from Using MacOSX Lion command line mail with Gmail as SMTP
Edit file /etc/postfix/main.cf
sudo vim /etc/postfix/main.cf
This is a collection of links, examples and rants about Presenters/Decorators in Rails.
The "Decorator" pattern slowly started gaining popularity in Rails several years ago. It is not part of core Rails, and there's many different interpretations about how it should work in practice.
Jay Fields wrote about it in 2007 (before he switched back to Java and then Clojure): http://blog.jayfields.com/2007/03/rails-presenter-pattern.html
namespace :json do | |
desc "Export all data to JSON files" | |
task :export => :environment do | |
Rails.application.eager_load! | |
ActiveRecord::Base.descendants.each do |model| | |
file = File.open(File.join(Rails.root, "db", "export", "#{model.table_name}.json"), 'w') | |
file.write model.all.to_json | |
file.close | |
end |