Skip to content

Instantly share code, notes, and snippets.

View wpj's full-sized avatar

Wyatt Johnston wpj

  • Chapel Hill, NC
View GitHub Profile
@wpj
wpj / airtable.rs
Created September 5, 2019 17:16
Airtable API wrapper
#[allow(unused)]
use reqwest::{header, Error};
#[allow(unused)]
use serde::{Deserialize, Serialize};
use std::marker::PhantomData;
static API_BASE_URL: &'static str = "https://api.airtable.com/v0";
pub struct Client(reqwest::Client);
@wpj
wpj / tree.js
Created August 22, 2019 18:34
Tree functions
function processNode({children, ...node}, index = [0]) {
let nodes = [];
if (node.type !== 'root') {
nodes.push({
...node,
__index: index,
});
}
if (node.type === 'root') {

Keybase proof

I hereby claim:

  • I am wpj on github.
  • I am yit_j (https://keybase.io/yit_j) on keybase.
  • I have a public key ASAZphOV0wmPQBz5GDuANbDvQZqg_5cGF5utMJLxn3aqfAo

To claim this, I am signing this object:

@wpj
wpj / keybase.md
Created November 24, 2016 04:45
Keybase proof

Keybase proof

I hereby claim:

  • I am wpj on github.
  • I am yit_j (https://keybase.io/yit_j) on keybase.
  • I have a public key ASCvrmC2sv9SvkFVQvY-K-vS9a8utYmyTOOLJ6nwb3Ihago

To claim this, I am signing this object:

@wpj
wpj / secret-santa.coffee
Created November 2, 2014 23:04
Secret Santa
# scenario: Emulate the game "Secret Santa" where there are 3 or more participants,
# no participant can receive their own gift or receive more than one gift.
class Santa
constructor: (@name, @gift) ->
santaPool = [
new Santa 'bob', 'beer'
new Santa 'carol', 'cat'
new Santa 'robert', 'ruby'
@wpj
wpj / javascript_resources.md
Created April 24, 2014 19:44 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@wpj
wpj / rails_resources.md
Created April 24, 2014 19:44 — forked from jookyboi/rails_resources.md
Rails-related Gems and guides to accelerate your web project.

Gems

  • Bundler - Bundler maintains a consistent environment for ruby applications. It tracks an application's code and the rubygems it needs to run, so that an application will always have the exact gems (and versions) that it needs to run.
  • rabl - General ruby templating with json, bson, xml, plist and msgpack support
  • Thin - Very fast and lightweight Ruby web server
  • Unicorn - Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.
  • SimpleCov - SimpleCov is a code coverage analysis tool for Ruby 1.9.
  • Zeus - Zeus preloads your Rails app so that your normal development tasks such as console, server, generate, and specs/tests take less than one second.
  • [factory_girl](h