Skip to content

Instantly share code, notes, and snippets.

@ghabs
ghabs / index.html
Last active December 31, 2015 09:29
This is a small program I wrote when I was interested in exploring my text message data and visualizing the frequency. It loads data from a JSON file, creates a scatterplot, and calls an external sentiment API to see if the messages were positive or negative. You can see it ‘live’ here: hsapp.s3-website-us-east-1.amazonaws.com (Firefox only, sin…
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<head>
<!-- JS -->
<script src="jquery.js"></script>
<script type="text/javascript" src="underscore.js"></script>
<script type="text/javascript" src="d3.v3.js"></script>
@ghabs
ghabs / index.html
Created March 14, 2014 21:20
Fork of the codrops timeline https://github.com/codrops/Blueprint-VerticalTimeline that includes a JS component to automatically put the correct date.
<div class="timeline">
<div class="w-container">
<h1 id="timeline">Timeline</h1>
<ul class="cbp_tmtimeline">
<li>
<time class="cbp_tmtime" datetime="2013-04-10 18:30"><span id="today"></span> <span>Now</span></time>
<div class="cbp_tmicon cbp_tmicon-phone"></div>
<div class="cbp_tmlabel">
<h2>Sign Up</h2>
@ghabs
ghabs / inferredDemo
Created April 9, 2014 18:50
GraphDive Inferred Demographics
curl --include --request GET 'https://community-graphdive.p.mashape.com/v1/profile/InferredDemographics.json/fb/<facebookId>?token=%3Ctoken%3E&key=%3Ckey%3E' \
--header "X-Mashape-Authorization: HZAMZr7fzsph5GrAA6t4stN2AUbCYnjH"
@ghabs
ghabs / reverseGeocode
Created April 9, 2014 18:52
Factual Reverse Geocode
curl -i -X POST \
-H "X-Mashape-Authorization: HZAMZr7fzsph5GrAA6t4stN2AUbCYnjH" \
-d "clientId=undefined" \
-d "clientSecret=undefined" \
-d "scope=<scope>" \
-d "callback=http://guardian.mashape.com/callback" \
"https://mashape-community-factual.p.mashape.com/oauth_url"
@ghabs
ghabs / nameSearch
Created April 9, 2014 18:55
Pipl Name Search
curl --include --request GET 'https://community-pipl.p.mashape.com/name/v2/json/?key=%3Ckey%3E&raw_name=Stone%20Matt%20Jr' \
--header "X-Mashape-Authorization: HZAMZr7fzsph5GrAA6t4stN2AUbCYnjH"
@ghabs
ghabs / app.js
Created April 16, 2014 22:44
Express API tutorial
var express = require('express');
var app = express();
app.use(express.bodyParser());
var headlines = [
{ author : 'John Smith', text : "You will not believe what this child does next."},
{ author : 'Jane Doe', text : "It started as a protest, then turned into a party. Thats not even the interesting part."},
{ author : 'Alice Example', text : "Can we squeeze two hundred jellybeans in one package? Yah probably."},
{ author : 'Bob Allan', text : "This famous celebrity is opposed to something you are too."}
{
"name": "hello-api",
"description": "hello api",
"version": "0.0.1",
"private": true,
"dependencies": {
"express": "3.x"
}
}
@ghabs
ghabs / app.js
Created April 17, 2014 21:48
Prelim App
var express = require('express');
var app = express();
app.get('/', function(req, res){
res.send('Hello Im going to be an API!');
});
app.listen(3000);
@ghabs
ghabs / headlines.json
Created April 17, 2014 21:49
Headlines
var headlines = [
{ author : 'John Smith', text : "You will not believe what this child does next."},
{ author : 'Jane Doe', text : "It started as a protest, then turned into a party. Thats not even the interesting part."},
{ author : 'Alice Example', text : "Can we squeeze two hundred jellybeans in one package? Yah probably."},
{ author : 'Bob Allan', text : "This famous celebrity is opposed to something you are too."}
];
@ghabs
ghabs / app.js
Created April 17, 2014 21:50
Updated App
var express = require('express');
var app = express();
var headlines = [
{ author : 'John Smith', text : "You will not believe what this child does next."},
{ author : 'Jane Doe', text : "It started as a protest, then turned into a party. Thats not even the interesting part."},
{ author : 'Alice Example', text : "Can we squeeze two hundred jellybeans in one package? Yah probably."},
{ author : 'Bob Allan', text : "This famous celebrity is opposed to something you are too."}
];