Skip to content

Instantly share code, notes, and snippets.

@aanari
aanari / Questions.md
Last active August 29, 2015 14:14
Campaign Questions Spec
@pearkes
pearkes / VagrantFile
Created March 17, 2012 23:31
Foreman-Ready Vagrant Box with Provisioner. Precise64 and Ruby 1.9.3.
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "precise64"
# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
@dragonai
dragonai / README.md
Last active October 9, 2015 01:09
Rollbar Time of Last Deploy

##Preview

Description

Simple Dashing widget that displays how long ago the last deploy was according to Rollbar.

##Usage

@mrdoob
mrdoob / gist:4247472
Created December 9, 2012 23:22
Is it possible to have event.offsetX always relative to the element with the listener?
/*
* +--------------------+
* | element1 |
* | +----------+ |
* | | element2 | |
* | +----------+ |
* +--------------------+
*
* (element2 is a child of element1)
*
@throughnothing
throughnothing / MojoEventSource.md
Last active December 16, 2015 06:39
Sample Mojolicious EventSource App that gets messages from a Stomp Message Queue

Mojolicious EventSource Example App

Dependencies

cpanm -n AnyEvent::STOMP Mojolicious List::MoreUtils

Test Message Queue

@throughnothing
throughnothing / coinbase-price.pl
Created December 2, 2013 18:39
Get Coinbase BTC Price
#!/usr/bin/env perl
use v5.10; use ojo;
say g('https://coinbase.com/api/v1/prices/buy')->json->{subtotal}{amount};
@EmperorEarth
EmperorEarth / CREDIT
Last active February 1, 2016 17:05
React-Router's onEnter <> requireAuth read from Redux store
// Comment: http://stackoverflow.com/questions/33643290/how-do-i-get-a-hold-of-the-store-dispatch-in-react-router-onenter/34278483#34278483
// User: http://stackoverflow.com/users/184532/kjs3
require 'pp'
require 'httparty'
class PagerDuty
include HTTParty
format :json
def initialize(subdomain, api_token)
@options = {
:headers => {
"Authorization" => "Token token=#{api_token}",

Map Data for Beginners

Data Formats

  • Shapefiles
  • *.shp
  • *.shx
  • *.dbf
  • *.prj
  • *.cpg
@aldendaniels
aldendaniels / alternative-to-higher-order-components.md
Last active October 6, 2018 09:50
Alternative to Higher-order Components

React now supports the use of ES6 classes as an alternative to React.createClass().

React's concept of Mixins, however, doesn't have a corollary when using ES6 classes. This left the community without an established pattern for code that both handles cross-cutting concerns and requires access to Component Life Cycle Methods.

In this gist, @sebmarkbage proposed an alternative pattern to React mixins: decorate components with a wrapping "higher order" component that handles whatever lifecycle methods it needs to and then invokes the wrapped component in its render() method, passing through props.

While a viable solution, this has a few drawbacks:

  1. There's no way for the child component to override functionality defined on the higher order component.