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
###Ruby is Just Like PHP, Except for a Few Things### | |
After a few attempts and failures to learn Ruby, it finally clicked when I accepted that Ruby was just different than PHP. After that, learning was easy. | |
If you're trying to learn Ruby as well, I'll do my best to compare Ruby to PHP (and sometimes javascript) which I found confusing, unexpected or tricky. When I can, I’ll try to explain why these "peculiarities" exist. | |
- Syntax differences in Ruby | |
- Classes, Objects and Scope | |
##Ruby Syntax## |
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
==> Downloading http://www.rabbitmq.com/releases/rabbitmq-server/v2.7.1/rabbitmq | |
File already downloaded in /Users/Jordan/Library/Caches/Homebrew | |
==> make | |
==> Exit Status: 2 | |
http://github.com/mxcl/homebrew/blob/master/Library/Formula/rabbitmq.rb#L16 | |
==> Environment | |
HOMEBREW_VERSION: 0.8.1 | |
HEAD: 684e3f8a155dc34ca96c61e7945a9d4406795c06 | |
HOMEBREW_PREFIX: /usr/local | |
HOMEBREW_CELLAR: /usr/local/Cellar |
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
1.9.2-p320 :034 > resp = api.get_order 'JJOI11M7LN' | |
MultiJson::DecodeError: 757: unexpected token at '<script type="text/javascript" src="https://sealserver.trustwave.com/seal.js?style=invert&size=65x36&code=55ad3fdf8f8f4a928e1c73ca8049d95d"></script> | |
{"id":"JJOI11M7LN","order_status":"approved","start_time":"2012-11-29 00:00:00","end_time":"2013-01-13 00:00:00","package_id":"LDWROVFINC","price":1275,"client":"Philly.com","Campaigns":[{"type":"cpm","delivery_status":"running","zone_id":"CUVM0V2AGW","website_id":"8E362LINC7","website_name":"NewsWorks","website_url":"http:\/\/www.newsworks.org\/","impressions":102000}],"FrequencyCapping":{"views":5,"period":24,"period_unit":"hour","id":"FC5_24H"},"GeoTargeting":[{"id":"GEOUS","description":"Includes all 50 states"}]}' | |
from /Users/jordan_isocket/.rvm/gems/ruby-1.9.2-p320/gems/json-1.7.5/lib/json/common.rb:155:in `parse' | |
from /Users/jordan_isocket/.rvm/gems/ruby-1.9.2-p320/gems/json-1.7.5/lib/json/common.rb:155:in `parse' | |
from /Users/jordan_isocket/.rvm/gems/r |
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
1.9.2-p320 :005 > resp = api.get_order 'IPWXS8ZFSF' | |
=> #<Buyads::Response::Base:0x007fd26e6a0de0 @response={"id"=>"IPWXS8ZFSF", "order_status"=>"canceled", "start_time"=>"2012-08-10 00:00:00", "end_time"=>"2012-08-25 00:00:00", "package_id"=>"5DV2MO84UJ", "price"=>1200, "client"=>"Jacob Markowitz <[email protected]>", "Campaigns"=>[{"type"=>"cpm", "delivery_status"=>"unregistered", "zone_id"=>"AG3B1Y4P7E", "website_id"=>"HQ5ROAFWWF", "website_name"=>"Skinny VS Curvy", "website_url"=>"http://skinnyvscurvy.com", "impressions"=>600000}]}> | |
1.9.2-p320 :006 > resp = api.get_order 'IPWXS8ZFSF' | |
MultiJson::DecodeError: 757: unexpected token at '<script type="text/javascript" src="https://sealserver.trustwave.com/seal.js?style=invert&size=65x36&code=55ad3fdf8f8f4a928e1c73ca8049d95d"></script> | |
{"id":"IPWXS8ZFSF","order_status":"canceled","start_time":"2012-08-10 00:00:00","end_time":"2012-08-25 00:00:00","package_id":"5DV2MO84UJ","price":1200,"client":"Jacob Markowitz <[email protected]>","Campaigns":[{"type":"cpm |
We can make this file beautiful and searchable if this error is corrected: It looks like row 7 should actually have 1 column, instead of 2 in line 6.
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
require 'mysql2' | |
require 'date' | |
require 'csv' | |
# Init values | |
results = [] | |
(1..48).each do |i| | |
results[i] = {active_count:0, total_count: 0} | |
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
// Add the following line: | |
//= require ./keentivate/index.js | |
// Before the line: | |
//= require_tree . |
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
getReferrerTraits = function() { | |
// Requires: jQuery, jQuery.cookie, segment.io | |
// TODO: Update referralHost:blackList with your domain, so we only track external referrers. | |
var analytics_args = [], | |
analytics_traits, | |
acquisitionSource, | |
firstReferrer, | |
firstCampaign, |
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
<html> | |
<head> | |
<script src="./js/jquery.js"></script> | |
<script src="./js/underscore.js"></script> | |
<script src="http://code.highcharts.com/highcharts.js"></script> | |
<script src="http://code.highcharts.com/modules/funnel.js"></script> | |
<script type="text/javascript" src="http://www.highcharts.com/highslide/highslide-full.min.js"></script> | |
<script type="text/javascript" src="http://www.highcharts.com/highslide/highslide.config.js" charset="utf-8"></script> | |
<link rel="stylesheet" type="text/css" href="http://www.highcharts.com/highslide/highslide.css" /> |
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
## Fetch related when fetching | |
fetch: (options) -> | |
console.log("Fetching order") | |
# Does not work when order is created by rotateOrder, and does not have an .id specified. | |
(OrderModel.__super__.fetch.apply(this, [])).then => | |
@fetch_related().then -> | |
options.success() if options.success? |
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
// ... | |
module.exports = function (grunt) { | |
// ... | |
// configurable paths | |
var yeomanConfig = { | |
app: 'app', | |
dist: 'dist', | |
phonegap: 'phonegap/www' |
OlderNewer