Skip to content

Instantly share code, notes, and snippets.

View thiagoramos23's full-sized avatar

Thiago Ramos thiagoramos23

View GitHub Profile
package controllers;
public class Application extends Controller {
// in cache during 1800 seconds (30 min)
@Cached(key = "pagingList", duration = 1800)
public static Result index(Integer page) {
String uuid = session("uuid");
if (uuid == null) {
uuid = java.util.UUID.randomUUID().toString();

Update and upgrade the system

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get autoremove
sudo reboot
# lib/tasks/deploy.rake
namespace :deploy do
desc 'Deploy to staging environment'
task :staging do
exec 'mina deploy -f config/deploy/staging.rb'
end
end
class BankAccount < ActiveRecord : :Base
. . .
def transfer_to( account , amount )
self . debt( amount )
account . credit( amount )
end
. . .
end
@thiagoramos23
thiagoramos23 / bank_account_2.rb
Created July 19, 2015 03:27
Bank Account another example
class BankAccount < ActiveRecord : :Base
. . .
def transfer_to( account , amount )
self . debt( amount )
account . credit( amount )
email_sender . send_account_changed_notification( account )
email_sender . send_account_changed_notification( self )
end
. . .
end
class BankAccount < ActiveRecord : :Base
. . .
def transfer_to( account , amount )
self . debt( amount )
account . credit( amount )
email_sender . send_account_changed_notification( account )
email_sender . send_account_changed_notification( self )
end
. . .
def paypal_transfer_to( account , amount )
#PayPal stuff
email_sender . send_account_changed_notification( account )
email_sender . send_account_changed_notification( self )
end
class AccountTransaction
. . .
def transfer( fromAccount , toAccount , amount )
fromAccount . debt( amount )
toAccount . credit( amount )
send_notifications_to_accounts( fromAccount , toAccount )
end
def paypal_transfer_to( fromAccount , toAccount , amount )
#PayPal stuff
Steps to Configuring for Xcode Developemnt:
1. Install Xcode
2. Ruby
3. Install RubyGems
4. Install LiftOff
-- https://github.com/thoughtbot/liftoff
5. Download Project from Bitbucket
6. Run the following command from the project folder:
-- liftoff
@thiagoramos23
thiagoramos23 / capybara cheat sheet
Last active September 1, 2015 11:42 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')