FridayHug.com http://fridayhug.com
The Smallest Rails App http://thesmallestrailsapp.com
%w(action_controller/railtie coderay).each &method(:require)| console.log('---'); | |
| // logic via: http://www.gamefaqs.com/gbc/446340-pokemon-silver-version/faqs/12550 | |
| // and http://upokecenter.dreamhosters.com/articles/pokemon-video-games/pokemon-gold-and-silver/changing-the-time-in-pokemon-gold-and-silver/#How_the_Game_Calculates_the_Password | |
| function $(id) { | |
| return document.getElementById(id); | |
| } | |
| function generatePassword() { |
| class MyMailer < ApplicationMailer | |
| def send_invoice user, invoice | |
| @user = user | |
| @invoice = invoice | |
| invoice_attachment = WickedPdf.new.pdf_from_string(render_to_string(pdf: "invoice", template: 'payments/charges/invoice.pdf.erb')) | |
| attachments["I#{sprintf('%06d', @invoice.id)}.pdf"] = invoice_attachment | |
| mail(to: @user.email, | |
| subject: "Your invoice", template_path: 'users_mailer') | |
| end | |
| end |
FridayHug.com http://fridayhug.com
The Smallest Rails App http://thesmallestrailsapp.com
%w(action_controller/railtie coderay).each &method(:require)| require 'prime' | |
| primes = [] | |
| number_to_compute = 999999999 | |
| while true do | |
| number_to_compute += 1 | |
| primes << number_to_compute if number_to_compute.prime? | |
| break if primes.size == 2 | |
| end |
| # Schedule script for using Whenever toghether with rbenv | |
| # | |
| # Whenever: https://github.com/javan/whenever | |
| # rbenv: https://github.com/sstephenson/rbenv | |
| set :env_path, '"$HOME/.rbenv/shims":"$HOME/.rbenv/bin"' | |
| # doesn't need modifications | |
| # job_type :command, ":task :output" |
| # http://www.iconoclastlabs.com/blog/rubymotion-android-in-the-emulator-with-genymotion | |
| app.api_version = "22" | |
| app.archs << 'x86' # for Genymotion support |
Prereq:
apt-get install zsh
apt-get install git-coreGetting zsh to work in ubuntu is weird, since sh does not understand the source command. So, you do this to install zsh
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
| sudo apt-get update | |
| sudo apt-get install curl git-core python-software-properties | |
| sudo apt-get install build-essential | |
| sudo apt-get install imagemagick libmagickwand-dev | |
| # PostgreSQL | |
| # sudo add-apt-repository ppa:pitti/postgresql | |
| # sudo apt-get update | |
| # sudo apt-get install postgresql libpq-dev | |
| sudo apt-get install postgresql-9.3 libpq-dev | |
| # SQLite3 |
| upstream unicorn { | |
| server unix:/tmp/unicorn.my_app.sock fail_timeout=0; | |
| } | |
| server { | |
| server_name my_app.com www.my_app.com; | |
| listen 80 default deferred; | |
| root /home/deployer/webapps/node/my_app/public; | |
| sudo apt-get update | |
| sudo apt-get install curl git-core software-properties-common | |
| sudo apt-get install build-essential | |
| sudo apt-get install imagemagick libmagickwand-dev | |
| # PostgreSQL | |
| sudo apt-get install postgresql-9.3 libpq-dev | |
| # SQLite3 | |
| sudo apt-get install sqlite3 libsqlite3-dev |