Skip to content

Instantly share code, notes, and snippets.

Eric Anderson aroc

Block or report user

Report or block aroc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
aroc /
Created Oct 3, 2016
How to fix phantomjs SIGSEGV error when using mocha-phantomjs on macOS Seierra

1. Install upx with brew:

brew install upx

2. Unpack the binary:

navigate to your project folder and run: upx -d node_modules/phantomjs/lib/phantom/bin/phantomjs

View email-extraction.js
var client = new Keen({
projectId: {PROJECT_ID},
readKey: {READ_KEY}
var query = new Keen.Query("extraction", {
eventCollection: "CourtesyHoldFunnel",
email: {YOUR_EMAIL}, // Put the email that you want the data extraction sent to here.
timeframe: {"end":"2015-09-15T09:15:00.000+00:00","start":"2015-09-11T09:15:00.000+00:00"}
View gist:9bffd2e3104ae262e31f
var videoIds = {
setOne: [1, 2, 3, 4, 5],
setTwo: [6, 7, 8, 9, 10]
var query = new Keen.Query("count", {
eventCollection: "videos",
filters: [
property_name: 'video_id',
aroc / parse-url.js
Created Feb 9, 2015
Parse URL into object
View parse-url.js
var search =;
JSON.parse('{"' + decodeURI(search).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g,'":"') + '"}');
aroc / simple-server.js
Created Jul 21, 2014
Simple node server
View simple-server.js
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(201, {'Content-Type': 'text/plain'});
res.end('{ "user_id": 1 }');
}).listen(8080, '');
console.log('Server running at');
aroc / deselectSection.js
Created Jun 15, 2014
SideComments deselectSection
View deselectSection.js
aroc / selectSection.js
Created Jun 15, 2014
SideComments selectSection
View selectSection.js
aroc / insertComment.js
Created Jun 15, 2014
SideComments insertComment
View insertComment.js
var comment = {
sectionId: 12,
comment: "Hey there!",
authorAvatarUrl: "users/avatars/test1.png",
authorName: "Jim Jones",
authorId: 16
aroc / setCurrentUser.js
Created Jun 15, 2014
SideComments setCurrentUser
View setCurrentUser.js
var currentUser = {
"id": 1,
"avatarUrl": "users/avatars/user1.png",
"name": "Jim Jones"
aroc / side-comments-listening-to-events
Last active Aug 29, 2015
SideComments listening to events example.
View side-comments-listening-to-events
// Listen to "commentPosted", and send a request to your backend to save the comment.
// More about this event in the "docs" section.
sideComments.on('commentPosted', function( comment ) {
url: '/comments',
type: 'POST'
data: comment,
success: function( savedComment ) {
// Once the comment is saved, you can insert the comment into the comment stream with "insertComment(comment)".
You can’t perform that action at this time.