Skip to content

Instantly share code, notes, and snippets.

View joshbeckman's full-sized avatar
👍

Josh Beckman joshbeckman

👍
View GitHub Profile
@joshbeckman
joshbeckman / faux-fountain.css
Created June 2, 2016 18:39
Transmute some hacky HTML markup conventions into screenplay display, inspired by http://fountain.io/_css/scrippets.css
body {
font-family: monospace;
max-width: 35rem;
margin: 0 auto;
display: block;
text-align: left !important;
}
h1,h2,h3,h4 {
/* used for characters */
text-align: center;
@joshbeckman
joshbeckman / fbevents.js
Created May 27, 2016 21:31
Facebook's new Audience ad tracking script
/*1464382852,,JIT Construction: v2361294,en_US*/
/**
* Copyright Facebook Inc.
*
* Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
*/
try {
(function(a, b, c, d) {
@joshbeckman
joshbeckman / fbds.js
Created May 27, 2016 21:30
Facebook deprecated/ing (supposedly) adds script
/*1464382085,,JIT Construction: v2361294,en_US*/
/**
* Copyright Facebook Inc.
*
* Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
*/
try {
(function(a, b, c, d) {

Drone Strike Data Visualization

Build a visualization of this dataset: http://www.dronestre.am/ (http://api.dronestre.am/data)

General Outline

  • Load the data
  • Make at least two views and/or an interactive representation of the data
  • Make sure it is optimized for both desktop and mobile viewing
  • Please use some kind of VCS (please, git) and commit multiple times to show us your thought/build process
@joshbeckman
joshbeckman / classy.js
Created October 12, 2015 14:19
An example showing the difference between prototypal inheritance and raw object usage in JavaScript
function Foo(who) {
this.me = who;
}
Foo.prototype.identify = function() {
return "I am " + this.me;
};
function Bar(who) {
Foo.call(this,who);
@joshbeckman
joshbeckman / index.js
Created October 10, 2015 17:37
An example Node.js server that can verify a Shopify webhook's integrity. Run with `node index.js`.
const PORT = 3000;
const SECRET = 'APP_SHARED_SECRET';
var http = require('http'),
crypto = require('crypto'),
server;
function verifyShopifyHook(req) {
var digest = crypto.createHmac('SHA256', SECRET)
.update(new Buffer(req.body, 'utf8'))
var crypto = require('crypto'),
secret = 'OUR_APP_SHARED_SECRET',
message = req.rawBody.toString('utf8'),
digest = crypto.createHmac('SHA256', secret)
.update(new Buffer(message, 'utf8'))
.digest('base64');
console.log(digest == req.headers['X-Shopify-Hmac-Sha256']);
// true
@joshbeckman
joshbeckman / .bash_func.sh
Last active August 29, 2015 14:18
Custom bash/shell functions I use
hello()
{
echo "Hello $1, let us be a friend." ;
}
grepr()
{
echo "";
echo ""; # space things out a bit for scanning
grep -r $1 $2 --color -n;
@joshbeckman
joshbeckman / test.js
Last active August 29, 2015 14:18
Test the CORS injection of js file...
// TEST ability to create your own divs and such
var _myDiv = document.createElement('div');
document.body.appendChild(_myDiv);
_myDiv.style.width = "50px";
_myDiv.style.height = "50px";
_myDiv.style.background = "black";
_myDiv.id = "foobar";
_myDiv.style.position = "fixed";
_myDiv.style.top = 0;
@joshbeckman
joshbeckman / .gitconfig
Last active August 29, 2015 14:18
My .gitconfig
[core]
editor = vim
[credential]
helper = cache
[alias]
co = checkout
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
st = status
s = status -sb
ci = commit -am