Skip to content

Instantly share code, notes, and snippets.


Will Prater wprater

View GitHub Profile

Keybase proof

I hereby claim:

  • I am wprater on github.
  • I am wprater ( on keybase.
  • I have a public key ASDMvnLkXnA9qP9UWdXaFxRdCZ4E0TWstWmTcAB70oXs9wo

To claim this, I am signing this object:

wprater / Dockerfile
Created June 14, 2017 15:56 — forked from yefim/
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
View Dockerfile
# Example Dockerfile
FROM hello-world
View person.js
// .lean()
.populate('contacts.person', 'id email avatar name nestedModel')
// FIXME feels like we should be able to get nested populations instead
// on building them inside the promise.
// .populate('contacts.person.nestedModel')
.then(function (doc) {
wprater / gist:8430194
Last active January 3, 2016 07:29
scaled agngle within min bounds
View gist:8430194
var radiusEarth = 6372.796924;
var dist = 2.0;
var maxAngle = dist / radiusEarth;
var minAngle = 0.25 / radiusEarth;
var cosdif = Math.cos(maxAngle) - 1;
var fuzzScale = Math.random() * (0.999999 - minAngle) + minAngle;
var scaledDist = Math.acos(fuzzScale * cosdif + 1);

#How to install node.js on a Google Compute Engine instance

Start and ssh into instance

Make sure you have a Google Compute engine account, have a project created and the gcutil command line tool installed.

Since want to ssh without the gcutil tool, you need to a your ssh key to the instance in addition to the already existing google_compute_engine key (used for gcutil).

wprater /
Last active December 17, 2015 22:29 — forked from dandavison/
class BaseChart
width: 100
height: 100
_margin: {}
@margin: top: 0, right: 0, bottom: 0, left: 0
wprater / store.js
Created August 29, 2012 21:43
Is there another way to apply a filter when specifying the store through a config option.
View store.js
xtype: 'list',
flex: 1,
store: 'localEntriesStore',
itemTpl: '{full_name}',
listeners: {
activate: function(list, opts) {
return list.getStore().filterBy(function(rec) {
return rec.get('needs_remote_sync');
wprater / resourceful.js
Created August 28, 2012 13:43
What is the preferred way to define a resourceful schema?
View resourceful.js
// Opt. 1 from resourceful Readme, examples, tests, etc.
var Creature = resourceful.define('creature', function () {
// Opt. 2 from other Flatiron project examples
Creature = resourceful.define('creature');'type', String, { default: "dragon" });
wprater / app_delegate.rb
Created August 22, 2012 21:23
Minimal ruby files for Cordova and RubyMotion.
View app_delegate.rb
class AppDelegate
def init
cookieStorage = NSHTTPCookieStorage.sharedHTTPCookieStorage
cookieStorage.cookieAcceptPolicy = NSHTTPCookieAcceptPolicyAlways
wprater / Rakefile
Created August 22, 2012 14:08
Setup file for RubyMotion to build Cordova apps.
View Rakefile
require 'motion/project'
Motion::Project::App.setup do |app|
# Use `rake config' to see complete project settings. = 'MyJavaScriptApp'
app.version = '1.0'
# My setup is a bit different, as Im building for many environements and the
# main app is written in JavaScript.