Skip to content

Instantly share code, notes, and snippets.

View jwaldrip's full-sized avatar
:octocat:

Jason Waldrip jwaldrip

:octocat:
View GitHub Profile
import _ from 'lodash';
import React from 'react';
import ReactDOM from 'react-dom';
import Relay from 'react-relay';
const nullNode = document.createElement('div');
class Infinity extends React.Component {
static propTypes = {
@jwaldrip
jwaldrip / _solution1.rb
Last active February 17, 2016 17:40
Code Challenge
module JSONAPIonify
module DeepSortCollection
refine Array do
def deep_sort(hash)
keys = hash.to_a
sorter = lambda do |iterator, depth = 0|
key_name, order = keys[depth]
if key_name
sorted = iterator.sort_by(&key_name)
sorted.reverse! if order == :desc
{
"meta": {
"allow": "GET, PATCH, DELETE, OPTIONS",
"resource": "users",
"attributes": [
{
"name": "first_name",
"read": true,
"write": true,
"required": false
{ "click": "http://bit.ly/1S0a8pK" }
@jwaldrip
jwaldrip / error
Last active October 27, 2015 19:23
Relay request missing listEdge in payload.
Warning: writeRelayUpdatePayload(): Expected response payload to include the newly created edge `listEdge` and its `node` field. Did you forget to update the `RANGE_ADD` mutation config?
@jwaldrip
jwaldrip / chronical_time.rb
Last active October 9, 2015 15:17
A module to make all of your timestamp setters parse with chronic.
module ChronicalTime
extend ActiveSupport::Concern
included do
timestamp_column_names =
self.columns
.reject { |col| col.name.in? %w{updated_at created_at} }
.select { |col| col.sql_type.starts_with? 'timestamp' }
.map(&:name)
@jwaldrip
jwaldrip / nano-uuid.rb
Created October 8, 2015 18:38
UUID Generation based off the current time down to the nano second plus a randomly generated hash.
t = Time.now
[t.to_i, t.nsec, rand(1_000_000_000)].map { |n| n.to_s(36) }.join('-')
# Example Output: "nvwzp5-xwno8-17cgms"
@jwaldrip
jwaldrip / blah.cr
Last active September 6, 2015 03:51
def something
end
'a'
"a"
1 + 1
1033edge.com
11mail.com
123.com
123box.net
123india.com
123mail.cl
123qwe.co.uk
150ml.com
15meg4free.com
163.com
@jwaldrip
jwaldrip / commands.txt
Last active August 29, 2015 14:17 — forked from lmars/commands.txt
# create a test app
flynn create --remote="" test-app
# create a release using the latest app image
flynn -a test-app release add -f config.json "https://registry.hub.docker.com?name=brandfolder/flynn-test-app&id=d0f2136468110ad368684c7ccb04e0a756830c18926e50a4ef0e87a8b46022a5"
# scale the server to one process, it should come up.
flynn -a test-app scale web=1
# curl the app, should get 'hello earth'