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
#!/usr/bin/env node | |
console.log("Promise test"); | |
var p1, p2, p3, p4; | |
var r1, r2, r3, r4; | |
p1 = new Promise(res => r1 = res); | |
p2 = new Promise(res => r2 = res); | |
p3 = new Promise(res => r3 = res); |
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
#!/usr/bin/env node | |
const { Readable } = require("stream"); | |
const { createReadStream, createWriteStream } = require("fs"); | |
const readline = require("readline"); | |
const DATA_MAX = 10000; | |
const DURATION_MAX = 10000; | |
function genDataStreamInner(dataMax, count, output) { |
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
#!/usr/bin/env node | |
const http = require('http'); | |
var neo4j = require('neo4j-driver').v1; | |
var prettyjson = require('prettyjson'); | |
var driver = neo4j.driver('bolt://54.162.113.152', neo4j.auth.basic('neo4j', 'password')); | |
var session = driver.session(); | |
function processUserData(data) { |
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
exports.generateCypherCreate = function(dataLabel, data) { | |
console.log("Data Label:", dataLabel); | |
var keys = Object.keys(data); | |
console.log("Keys:", keys); | |
var create = "CREATE (n: " + dataLabel " {"; | |
create += keys.map( key => key + ": " + data[key]).join(", "); | |
create += "}) RETURN n"; | |
}; |
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
var list = [1, 2, 3, 4]; | |
var doubled = list.map(item => item * 2); | |
console.log(list); | |
console.log(doubled); |
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
# 2013-11-08 14:00:26:707 [CREATE] ("test_listings") | |
# | |
curl -X POST http://localhost:9201/test_listings -d '{"mappings":{"listing":{"properties":{"slug":{"type":"string"},"name":{"analyzer":"snowball","type":"string"},"description":{"type":"string"},"space_type_name":{"as":{},"type":"string"},"usages":{"as":{},"type":"string"},"amenities":{"as":{},"type":"string"},"nearbies":{"as":{},"type":"string"},"tags":{"as":{},"type":"string"},"camera_ok":{"type":"string"},"charitable":{"type":"string"},"accessible":{"type":"string"},"active":{"type":"string"},"demoable":{"as":"activatable?","type":"string"},"location_id":{"type":"string"},"location_slug":{"as":"location_slug","type":"string"},"location_name":{"as":"location_name","type":"string"},"location_lat_lon":{"as":"location_lat_lon","type":"geo_point"},"location_address":{"as":"location_address","index":"not_analyzed","type":"string"},"location_profile_image_url":{"as":"location_profile_image_url","index":"not_analyzed","type":"string"},"usages_for_facet":{"as": |
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
def setup_marketplace | |
api_key = Balanced::ApiKey.new.save | |
Balanced.configure api_key.secret | |
@marketplace = Balanced::Marketplace.new.save | |
# Add money to the account, so that it is useful... | |
card = @marketplace.create_card( | |
:card_number => "5105105105105100", | |
:expiration_month => "12", |
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
#<Balanced::Credit:0x007fa6d9c68180 | |
@attributes= | |
{"amount"=>999, | |
"bank_account"=> | |
{"credits_uri"=>"/v1/bank_accounts/BA6yUq1nvNWoe6qhmOEnzBSC/credits", | |
"bank_name"=>nil, | |
"_type"=>"bank_account", | |
"bank_code"=>"9900000000", | |
"account"=> | |
#<Balanced::Account:0x007fa6d9f11490 |
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
ails s 5000 ~/Code/nozomi | |
WARNING: Cucumber-rails required outside of env.rb. The rest of loading is being defered until env.rb is called. | |
To avoid this warning, move 'gem cucumber-rails' under only group :test in your Gemfile | |
Exiting | |
/usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rack-1.3.6/lib/rack/handler.rb:63:in `require': cannot load such file -- rack/handler/5000 (LoadError) | |
from /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rack-1.3.6/lib/rack/handler.rb:63:in `try_require' | |
from /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rack-1.3.6/lib/rack/handler.rb:16:in `get' | |
from /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rack-1.3.6/lib/rack/server.rb:269:in `server' | |
from /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/commands/server.rb:59:in `start' | |
from /usr/local/Cellar/ruby/1.9.3-p125/lib/ruby/gems/1.9.1/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
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin:/Users/jasocox/.rvm/bin:/Users/jasocox/src/android-sdk-mac_x86/tools:/Users/jasocox/src/android-sdk-mac_x86/platform-tools:/Users/jasocox/.rvm/bin:/usr/local/Cellar/ruby/1.9.3-p125/bin |