This file contains hidden or 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
| node_modules | |
| secrets.js |
This file contains hidden or 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 Person < ActiveRecord::Base | |
| def full_name | |
| "#{self.first_name} #{self.last_name}" | |
| end | |
| end |
This file contains hidden or 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 Person < ActiveRecord::Base | |
| def full_name | |
| “#{self.name} #{self.last_name}” | |
| end | |
| end |
This file contains hidden or 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
| # Just wanted to clarify my points at the meetup last night. | |
| # | |
| # There were two different issues intertwined: | |
| # (1) Whether to use extend or "include as extend" | |
| # (2) When using "include as extend", what is the simplest way to achieve the goal? | |
| # | |
| # My personal opinion is that the answer to (1) is "extend", not "include as extend", but that | |
| # is just my personal opinion. My answer to (2) is a more empirical question. | |
| # Using the "extend" approach. Again, I personally prefer the simplicity of this approach, but |
This file contains hidden or 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
| apt-get install libreadline-dev | |
| ./configure --prefix=/usr && make && make install DESTDIR=/tmp/ruby193 | |
| fpm -s dir -t deb -n ruby -v 1.9.3-p125 -C /tmp/ruby193 \ | |
| -p ruby-VERSION_ARCH.deb -d "libstdc++6 (>= 4.4.3)" \ | |
| -d "libc6 (>= 2.6)" -d "libffi5 (>= 3.0.4)" -d "libgdbm3 (>= 1.8.3)" \ | |
| -d "libncurses5 (>= 5.7)" -d "libreadline6 (>= 6.1)" \ | |
| -d "libssl0.9.8 (>= 0.9.8)" -d "zlib1g (>= 1:1.2.2)" \ | |
| usr/bin usr/lib usr/share/man usr/include |
This file contains hidden or 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
| def update | |
| if params[:webby][:hostname] | |
| update_hostname | |
| else | |
| @webby.update_attributes extract_params | |
| end | |
| respond_with(@webby) | |
| end |
This file contains hidden or 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
| events: | |
| # outros eventos aki | |
| 'click #hostname' : 'showEditHostnameForm' | |
| 'click #cancel_update_hostname' : 'cancelEditHostnameForm' | |
| 'click #update_hostname' : 'update_hostname' | |
| update_hostname: (e) -> | |
| e.preventDefault() | |
| hostname = $('#webby_hostname').val() | |
| @model.save |
This file contains hidden or 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
| # Run this file with `RAILS_ENV=production rackup -p 3000 -s thin` | |
| # Be sure to have rails and thin installed. | |
| require "rubygems" | |
| require "rails" | |
| # Let's load only action controller. If you want | |
| # to use active record, just require it as well. | |
| require "action_controller/railtie" | |
| class MyApp < Rails::Application |
This file contains hidden or 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
| require File.expand_path('../../../spec_helper', __FILE__) | |
| require './app/services/invoice/create_service' | |
| class InvoiceForCreateService | |
| include Invoice::CreateService | |
| attr_reader :userid | |
| end | |
| class InvoiceCreationError < StandardError; end |
This file contains hidden or 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 Client | |
| # (..) | |
| def add_prepaid_credit(amount) | |
| invoice_fields = { 'duedate' => Date.today, | |
| 'autoapplycredit' => false, | |
| 'itemdescription1' => 'Prepaid credit', | |
| 'itemamount1' => amount } | |
| response = create(invoice_fields) |