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
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script><!-- required to getJSON from our server --> | |
<script src="https://datejs.googlecode.com/files/date.js"></script><!-- required to parse dates in ISO format --> | |
<script> | |
var device_tracking_type = "mac_address"; | |
var current_user_device_type = "android"; | |
var current_user_country_code = "ca"; | |
var current_user_mac_address = "11:11:11:11"; | |
var current_user_location = "37.8188,-122.4784"; | |
var current_impression_uuid = "mynetworkimpression-iowd23e823jsd094"; | |
var current_time = new Date(); |
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
import ( | |
"bufio" | |
"os" | |
) | |
// readWholeLine returns a single line (without the ending \n) from the input buffered reader. | |
// An error is returned iff there is an error with the buffered reader. | |
func readWholeLine(r *bufio.Reader) (string, error) { | |
var (isPrefix bool = true | |
err error = nil |
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
{ | |
"IAB1": "Arts & Entertainment", | |
"IAB1-1": "Books & Literature", | |
"IAB1-2": "Celebrity Fan/Gossip", | |
"IAB1-3": "Fine Art", | |
"IAB1-4": "Humor", | |
"IAB1-5": "Movies", | |
"IAB1-6": "Music", | |
"IAB1-7": "Television", | |
"IAB2": "Automotive", |
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
# Call me with linked_in_by_company('Disney') | |
LINKEDIN = { | |
api_key: ENV['LINKEDIN_API_KEY'], | |
secret_key: ENV['LINKEDIN_SECRET_KEY'], | |
consumers: { | |
test_person: { | |
consumer_token: ENV['LINKEDIN_TESTPERSON_CONSUMER_TOKEN'], | |
consumer_secret: ENV['LINKEDIN_TESTPERSON_CONSUMER_SECRET'] |
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
# Here is some sample code to create a CloudFront distribution programmatically from Ruby. | |
# Tested to be working on 06-23-2012. | |
# Amazon's documentation is wrong, so we're putting the XML here! | |
# | |
# We're using this at http://www.crowdmob.com/ to simplify our development process. | |
# | |
# Prerequisite: You'll need the simple_aws gem which you can get from `gem install simple_aws` | |
# | |
require 'simple_aws/s3' |
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
== RemoveNameFromOrganizations: migrating ==================================== | |
-- remove_column(:organizations, :name) | |
-> 0.1580s | |
-- add_index(:organizations, :domain, {:unique=>true}) | |
rake aborted! | |
An error has occurred, all later migrations canceled: | |
ActiveRecord::JDBCError: Key column 'domain' doesn't exist in table: CREATE UNIQUE INDEX `index_organizations_on_domain` ON `organizations` (`domain`) | |
Tasks: TOP => db:migrate |
NewerOlder