This file contains 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
message = "You have been granted to #{pluralize(industry_names.count, "industry")}: #{industry_list.join(', ')}" | |
@user.send_to_slack(message) |
This file contains 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 WalkSectionController < ApplicationController | |
def go_for | |
@walk_section = WalkSection.find(params[:id]) | |
@walk = @walk_section.walk | |
# full_url = request.base_url + request.path | |
# i = full_url.rindex( '/' ) | |
@base_url = request.base_url | |
@walk_section_buttons = @walk_section.walk_section_buttons | |
end |
This file contains 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
Results of ping while running speedtest at http://www.dslreports.com/speedtest | |
PING google.com (173.194.192.102): 56 data bytes | |
64 bytes from 173.194.192.102: icmp_seq=0 ttl=42 time=41.444 ms | |
64 bytes from 173.194.192.102: icmp_seq=1 ttl=42 time=41.425 ms | |
64 bytes from 173.194.192.102: icmp_seq=2 ttl=42 time=41.300 ms | |
64 bytes from 173.194.192.102: icmp_seq=3 ttl=42 time=42.305 ms | |
64 bytes from 173.194.192.102: icmp_seq=4 ttl=42 time=44.678 ms | |
64 bytes from 173.194.192.102: icmp_seq=5 ttl=42 time=44.088 ms | |
64 bytes from 173.194.192.102: icmp_seq=6 ttl=42 time=48.350 ms |
This file contains 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 'layouts/header' unless current_page?(root_url) %> |
This file contains 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
<h1>All the Phones I know about!</h1> | |
<div id="every-phone"> | |
<% @phones.each do |fone| %> | |
<h5><%= fone.name %></h5> | |
<% end %> | |
</div> |
This file contains 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 PhonesController < ApplicationController | |
def index | |
@phones = Phone.all | |
end | |
end |
This file contains 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 Product < ApplicationRecord | |
scope :published, -> { | |
where(:is_published => true) | |
} | |
belongs_to :category | |
validates_presence_of :name, :price | |
mount_uploader :image, ImageUploader | |
validates_processing_of :image |
This file contains 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
# NOTICE: to get Nginx+Unicorn best-practices configuration see the gist https://gist.github.com/3052776 | |
$ cd /usr/src | |
$ wget http://nginx.org/download/nginx-1.2.1.tar.gz | |
$ tar xzvf ./nginx-1.2.1.tar.gz && rm -f ./nginx-1.2.1.tar.gz | |
$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz | |
$ tar xzvf pcre-8.30.tar.gz && rm -f ./pcre-8.30.tar.gz | |
$ wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz |
This file contains 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
irb(main):002:0> origin = TaxCloud::Address.new(address1: '7297 E. Shore Rd.', address2: '', city: 'traverse city', state: 'michigan', zip5: '49686') | |
=> #<TaxCloud::Address:0x007fc17f6e5080 @address1="7297 E. Shore Rd.", @address2="", @city="traverse city", @state="michigan", @zip5="49686"> | |
irb(main):003:0> dest = TaxCloud::Address.new(address1: '659 Cork Pine Ln.', address2: '', city: 'Vassar', state: 'michigan', zip5: '48768') | |
=> #<TaxCloud::Address:0x007fc17dce3e48 @address1="659 Cork Pine Ln.", @address2="", @city="Vassar", @state="michigan", @zip5="48768"> | |
irb(main):004:0> transaction = TaxCloud::Transaction.new(customer_id: 1, cart_id: 1, origin: origin, destination: dest) | |
=> #<TaxCloud::Transaction:0x007fc17f7d71c8 @cart_items=[], @customer_id=1, @cart_id=1, @origin=#<TaxCloud::Address:0x007fc17f6e5080 @address1="7297 E. Shore Rd.", @add | |
irb(main):005:0> transaction.cart_items << TaxCloud::CartItem.new(index: 1, item_id: 'sku-02', tic: TaxCloud::TaxCodes::GENERAL, price: '14.00', quantity: 2) | |
=> [#<Tax |
This file contains 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
be rake db:migrate | |
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /Users/james/Code/CCE/Rakefile:9) | |
Connecting to database specified by database.yml | |
** vote_fu: initialized properly. | |
DEPRECATION WARNING: Calling set_table_name is deprecated. Please use `self.table_name = 'the_name'` instead. (called from <class:Feedback> at /Users/james/Code/CCE/app/models/feedback.rb:5) | |
PG::UndefinedTable: ERROR: relation "feedback" does not exist | |
LINE 5: WHERE a.attrelid = '"feedback"'::regclass | |
^ | |
: SELECT a.attname, format_type(a.atttypid, a.atttypmod), | |
pg_get_expr(d.adbin, d.adrel |
NewerOlder