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
/** | |
* @providesModule Effects | |
* @flow | |
*/ | |
import { Linking } from 'react-native'; | |
import AppDataApi from 'AppDataApi'; | |
import Actions from 'Actions'; | |
import ActionTypes from 'ActionTypes'; |
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
tooltips.each do |method, text| | |
define_method(method) { tooltip text['display'], text['tip'] } | |
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
file_name = File.basename(@account.logo.url) | |
tmp_file = Rails.root.join('tmp', file_name).to_s | |
File.open(tmp_file, "wb") do |f| | |
f.write open(@account.logo.url).read | |
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
filepath = "#{Rails.root.join('tmp')}/new" | |
File.open(filepath, "wb") do |f| | |
f.write open(@account.logo.url).read | |
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
<%= render :partial => "bottom_resource", :collection => @bottom_resources, :as => :resource %> | |
<%= render :partial => "sidebar_resource", :collection => @sidebar_resources, :as => :resource %> |
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
# Usage: | |
# rails new myapp --template=path/to/this/file.rb | |
appname = File.expand_path(Dir.new('.')).split('/').last | |
#--------------- Gem setup | |
# Note this is mostly copied from puzzlenode | |
# | |
file 'Gemfile', <<_____ | |
source 'http://rubygems.org' |
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
## Form Template Method (http://refactoring.com/catalog/formTemplateMethod.html) | |
class Site | |
end | |
class ResidentialSite < Site | |
def initialize | |
@units = 1.0 | |
@rate = 2.0 |
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
## Self Encapsulate Field (http://refactoring.com/catalog/selfEncapsulateField.html) | |
class Fieldz | |
def initialize | |
@low = -1 | |
@high = 50 | |
end | |
def includes(arg) |
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
## Extract Class (http://refactoring.com/catalog/extractClass.html) | |
class Person | |
attr_accessor :name, :office_area_code, :office_number | |
def telephone_number | |
[office_area_code, office_number].join('-') | |
end | |
end |