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
aroc / fix-mocjha-phantomjs-SIGSRGV.md
Created Oct 3, 2016
How to fix phantomjs SIGSEGV error when using mocha-phantomjs on macOS Seierra
View fix-mocjha-phantomjs-SIGSRGV.md

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}
});
Keen.ready(function(){
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
aroc / parse-url.js
Created Feb 9, 2015
Parse URL into object
View parse-url.js
var search = location.search.substring(1);
JSON.parse('{"' + decodeURI(search).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g,'":"') + '"}');
@aroc
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 }');
return;
}).listen(8080, '127.0.0.1');
console.log('Server running at http://127.0.0.1:8080/');
@aroc
aroc / deselectSection.js
Created Jun 15, 2014
SideComments deselectSection
View deselectSection.js
sideComments.deselectSection(12);
@aroc
aroc / selectSection.js
Created Jun 15, 2014
SideComments selectSection
View selectSection.js
sideComments.selectSection(12);
@aroc
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
};
sideComments.insertComment(comment);
@aroc
aroc / setCurrentUser.js
Created Jun 15, 2014
SideComments setCurrentUser
View setCurrentUser.js
var currentUser = {
"id": 1,
"avatarUrl": "users/avatars/user1.png",
"name": "Jim Jones"
};
sideComments.setCurrentUser(currentUser);
@aroc
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 ) {
$.ajax({
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)".
sideComments.insertComment(comment);
You can’t perform that action at this time.