Skip to content

Instantly share code, notes, and snippets.

View arockwell's full-sized avatar

Alex Rockwell arockwell

View GitHub Profile

Keybase proof

I hereby claim:

  • I am arockwell on github.
  • I am alexrockwell (https://keybase.io/alexrockwell) on keybase.
  • I have a public key ASAfWQFL_oX3tYueOlCBe14OrpANgsBgAY2qQUxEL2l67wo

To claim this, I am signing this object:

@arockwell
arockwell / server.js
Created December 12, 2017 20:29
Simple GraphQL proxy
var express = require('express');
var graphqlHTTP = require('express-graphql');
var { buildSchema } = require('graphql');
var fetch = require('node-fetch');
// Construct a schema, using GraphQL schema language
var schema = buildSchema(`
type User {
first_name: String
last_name: String
2) Apns #processBatch() should pass:
Error: global leak detected: key
at Runner.checkGlobals (/usr/local/lib/node_modules/mocha/lib/runner.js:104:21)
at Runner.<anonymous> (/usr/local/lib/node_modules/mocha/lib/runner.js:43:44)
at Runner.emit (events.js:88:20)
at /usr/local/lib/node_modules/mocha/lib/runner.js:321:16
at done (/usr/local/lib/node_modules/mocha/lib/runnable.js:134:5)
at Test.run (/usr/local/lib/node_modules/mocha/lib/runnable.js:149:7)
at Runner.runTest (/usr/local/lib/node_modules/mocha/lib/runner.js:272:10)
at /usr/local/lib/node_modules/mocha/lib/runner.js:316:12
checkRedis = () ->
redis.ping (err, data) ->
if err then false else true
node-c2dm (master) $ gitc setup arockwell node-c2dm ed50a0830
Configuration saved.
node-c2dm (master) $ gitc branch https://bleacherreport.lighthouseapp.com/projects/6296-bug-reporting/tickets/8858-node-c2dm-disable-retry-on-quota-errors
Your work will eventually merge into 'master'. Is this correct? (y/n)
y
Retrieving branch information from gitcycle.
redis 127.0.0.1:6379> get 'batch_count:QDLKFEJ1340:android'
"4"
redis 127.0.0.1:6379> get 'batch_count:QDLKFEJ1341:android'
"3"
redis 127.0.0.1:6379> get 'batch_count:QDLKFEJ1341:android'
"3"
redis 127.0.0.1:6379> get 'batch_count:QDLKFEJ1341:android'
"3"
redis 127.0.0.1:6379> get 'batch_count:QDLKFEJ1341:android'
"3"
updateRedisBatchInfo = (batch_id, device_type, count) ->
console.log("Setting key: sent_alerts:#{batch_id}:#{device_type}")
redis.incrby("sent_alerts:#{batch_id}:#{device_type}", count)
redis.incrby("batch_count:#{batch_id}:#{device_type}", 1)
redis.get("batch_count:#{batch_id}:#{device_type}", (err, data) ->
console.log("sent: #{data}")
)
ActiveRecord::Base.connection.execute("delete from article_info where article_id = 1")
article_infos = ArticleInfo.find_all_by_article_id(1)
article_infos.size.should == 0
article_copy1 = Article.find(1)
article_copy1.article_info.should == nil
article_copy2 = Article.find(1)
article_copy2.article_info.should == nil
puts "BEFORE LAST_SLIDE ASSIGNMENT 1"
puts "article_copy1 #{article_copy2.article_info.inspect}"
puts "article_copy2 #{article_copy2.article_info.inspect}"
BEFORE LAST_SLIDE ASSIGNMENT 1
article_copy1 nil
article_copy2 nil
BEFORE LAST_SLIDE ASSIGNMENT 2
article_copy1 nil
article_copy2 nil
BEFORE article_copy1 save
article_copy1 #<ArticleInfo id: 17, article_id: 1, last_slide_id: 2, created_at: "2012-06-26 21:16:29", updated_at: "2012-06-26 21:16:29", league_override: false, external_url: nil, external_source: nil, click_count: 0, top: nil, comments_disabled: nil, user_agent: nil, edit_stack: nil, draggable_media: false, no_skins: false, headline_edited_by: nil, highlighted_comment_id: nil, reads_disabled: nil, no_autolink: nil, signature_content: false, top_commenters: nil>
article_copy2 #<ArticleInfo id: 17, article_id: 1, last_slide_id: 2, created_at: "2012-06-26 21:16:29", updated_at: "2012-06-26 21:16:29", league_override: false, external_url: nil, external_source: nil, click_count: 0, top: nil, comments_disabled: nil, user_agent: nil, edit_stack: nil, draggable_media: false, no_skins: false, headline_edited_by: nil, highlighted_comment_id: nil, reads_disabl
ActiveRecord::Base.connection.execute("delete from article_info where article_id = 1")
article_infos = ArticleInfo.find_all_by_article_id(1)
article_infos.size.should == 0
article_copy1 = Article.find(1)
puts "article_info1: #{article_copy1.article_info}"
article_copy2 = Article.find(1)
puts "article_info2: #{article_copy2.article_info}"
article_copy1.last_slide = 1
article_copy2.last_slide = 2