Skip to content

Instantly share code, notes, and snippets.

View Ravenstine's full-sized avatar

Ten Bitcomb Ravenstine

View GitHub Profile
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
CONTEST_ID CONTEST_ORDER CANDIDATE_ORDER TOTAL CANDIDATE_PARTY_ID CANDIDATE_ID VOTE_FOR CONTEST_TYPE CANDIDATE_TYPE TOTAL_PRECINCTS PROCESSED_DONE PROCESSED_STARTED IS_WRITEIN_CANDIDATE CONTEST_FULL_NAME CANDIDATE_FULL_NAME CONTEST_TOTAL undervote overvote IS_WINNER cf_cand_class IS_PRECINCT_LEVEL PRECINCT_NAME is_visible
0 -100 1 0 6 0 -2 0 0 0 0 0 Registration & Turnout Precinct Turnout 0 0 0 0 candidate 0 0
0 -100 2 0 1 0 -2 0 0 0 0 0 Registration & Turnout Vote by Mail Turnout 0 0 0 0 candidate 0 0
3 3 1 0 3 60 1 0 0 1856 0 0 0 Governor GRN - JOSH JONES 0 0 0 candidate 0 0
3 3 2 0 2 61 1 0 0 1856 0 0 0 Governor DEM - J. BRIBIESCA 0 0 0 candidate 0 0
3 3 3 0 5 62 1 0 0 1856 0 0 0 Governor PF - GLORIA ESTELA LA RIVA 0 0 0 candidate 0 0
3 3 4 0 6 63 1 0 0 1856 0 0 0 Governor REP - PETER Y LIU 0 0 0 candidate 0 0
3 3 5 0 2 64 1 0 0 1856 0 0 0 Governor DEM - ANTONIO VILLARAIGOSA 0 0 0 candidate 0 0
3 3 6 0 6 65 1 0 0 1856 0 0 0 Governor REP - YVONNE GIRARD 0 0 0 candidate 0 0
3 3 7 0 2 66 1 0 0
@Ravenstine
Ravenstine / shoebox.js
Last active March 13, 2018 04:48
Ember Fastboot Shoebox Mixin
// app/mixins/shoebox.js
import Ember from 'ember';
import fetch from 'fetch';
const {
Mixin,
RSVP: {Promise},
inject: {service}
} = Ember;
'use strict';
const assistants = {
alexa: [
'session',
'request',
'version'
],
google: [
'user',
@Ravenstine
Ravenstine / en-US.json
Created January 30, 2018 19:24
UBER FOR DOGS
{
"interactionModel":
{
"languageModel": {
"types": [
{
"name": "WoofCount",
"values": [
{
"id": "woof2",
{
"$schema": "http://json-schema.org/draft-04/schema#",
"definitions": {
},
"id": "http://example.com/example.json",
"properties": {
"plus_stream_url": {
"id": "/properties/plus_stream_url",
"type": "string"
},
'use strict';
const cheerio = require('cheerio');
const YAML = require('js-yaml');
const TYPE = {
string(obj){
// Sometimes, when using the YAML parser, a valid string
// will seem like a K/V pair to the parser. For strings
// that are likely to contain colons with multiple lines,
@Ravenstine
Ravenstine / aws-couchdb-setup.md
Last active April 19, 2024 15:03
Fast CouchDB setup in AWS

Fast CouchDB setup in AWS

CouchDB is a NoSQL database for storing JSON documents. It comes with a REST API out of the box so your client applications can persist data while requiring you to write little or no server-side code. CouchDB's killer feature is its ability to easily replicate, which allows for horizontal scaling, easy backup, and for client adapters to synchronize documents. This is perfect if you want to write an application that is offline-first. It's become my go-to database when creating new

'use strict';
const express = require('express');
const fs = require('fs');
const http = require('http');
const https = require('https');
const RewindBuffer = require('./lib/rewind-buffer');
let rewindBuffer = new RewindBuffer({maxFrames: 300});
let app = express();
@Ravenstine
Ravenstine / rewind-buffer.js
Created May 23, 2017 17:04
Rewind Buffer
'use strict';
class Frame {
constructor(samples){
// A single frame == 1 second of audio with a 44100 sample rate
this.prev = null;
this._next = null;
// this.samples = samples || new Float32Array(44100);
this.samples = samples || [];
this.callbacks = [];
@Ravenstine
Ravenstine / maya-websocket.py
Last active May 25, 2021 02:45
Maya Websocket
import maya.cmds
import maya.utils
from SimpleWebSocketServer import SimpleWebSocketServer, WebSocket
from threading import Thread
class SimpleEcho(WebSocket):
def handleMessage(self):
# echo message back to client
#self.sendMessage(maya.utils.executeInMainThreadWithResult(self.data))