##References
##Create Rails App
command to make new directory:
mkdir AppName
| doc = Nokogiri::XML(res.body) | |
| @doc = doc.xpath('//mdn').each do |record| | |
| @carriercode = record.at('@carrier').text | |
| end | |
| @carriercode | |
##References
##Create Rails App
command to make new directory:
mkdir AppName
| ="http://example.com/" & SUBSTITUTE(R12, "#", "") |
| For more info: | |
| http://code.google.com/apis/analytics/docs/tracking/gaTrackingSocial.html | |
| http://www.socialmediaexaminer.com/how-to-track-tweets-facebook-likes-and-more-with-google-analytics/ | |
| Place between <head></head> tags: | |
| <head> |
| variable = 'something' | |
| case variable | |
| when some_string.match(/\d/) | |
| puts 'String has numbers' | |
| when some_string.match(/[a-zA-Z]/) | |
| puts 'String has letters' | |
| else | |
| puts 'String has no numbers or letters' | |
| end |
##References
##Create Empty Migration command:
rails generate migration MyNewMigration
##Empty Migration Example
class TenderloveMigration < ActiveRecord::Migration
| # reference: http://tomdoc.org/ | |
| # Public: Add two numbers together. | |
| # | |
| # value1 - The first number. | |
| # value2 - The second number. | |
| # | |
| # Examples | |
| # | |
| # add(1, 2) |
In terminal:
heroku addons:add newrelic:standard
Add this gem to your Gemfile: gem 'newrelic_rpm'
| require 'csv' | |
| require 'json' | |
| csv_string = CSV.generate do |csv| | |
| JSON.parse(File.open("filename.json").read).each do |hash| | |
| data = hash[1] | |
| theline = theline + " #{data}," | |
| end | |
| end |