Skip to content

Instantly share code, notes, and snippets.

View jsclayton's full-sized avatar

John Clayton jsclayton

View GitHub Profile
@jsclayton
jsclayton / number_as_string.go
Created February 26, 2015 21:42
Encode & decode a JSON string as a number in Go
package main
import (
"encoding/json"
"fmt"
)
type Product struct {
Name string
Price float64 `json:",string"`
@jsclayton
jsclayton / events.json
Last active September 25, 2015 04:48
Arcade events feed
{
"name": "The name of the event",
"share_url": "This should be the URL used by the share button, i.e. to the page on arcadenw.org",
"event_types": [ "Array", "of", "event", "types" ],
"location": {
"name": "The name of the location",
"street_address": "The street address",
"city": "The city",
"state": "The state",
"zip": "The zip",
@jsclayton
jsclayton / rest.js
Created February 18, 2016 15:29
Upload file from the browser
import immutable from 'immutable';
import request from 'superagent';
import userSession from './store/userSession';
const OAUTH_TOKEN = 'Authorization';
function doRequest(req, headers={}) {
let token = userSession.store.current.get('access_token');
if (token) {
headers[OAUTH_TOKEN] = `Bearer ${token}`;