This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const create = ({ | |
| shouldBackoff, | |
| factor = 5, | |
| maxDelay = 32000, | |
| maxAttempts = 20 | |
| }) => { | |
| const backoff = attempt => { | |
| const randomMs = Math.floor(Math.random() * 1000); | |
| const exponential = Math.pow(factor, attempt) + randomMs; | |
| const delay = Math.min(exponential, maxDelay); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <title>Apollo Query Reproduction</title> | |
| <meta charset="UTF-8" /> | |
| </head> | |
| <body> | |
| <div id="app"> | |
| <h1>These are the headers that get sent along:</h1> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fs = require('fs'); | |
| const path = require('path'); | |
| const { CLIEngine } = require('eslint'); | |
| const readline = require('readline-sync'); | |
| const cli = new CLIEngine({ | |
| parser: 'babel-eslint', | |
| useEslintrc: false, | |
| plugins: ['react'], | |
| rules: { 'react/prop-types': ['error', {}] } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import PropTypes from 'prop-types'; | |
| import { set, get } from 'lodash/fp'; | |
| /** | |
| * This is a copy-pasta job of Formik's Field component. It's needed in | |
| * order to handle nested values. Future versions of formik will support | |
| * this. | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class After < Struct.new(:text) | |
| def call | |
| text.gsub(Model::FIXES[0], 'saved_change_to_\1?') | |
| .gsub(Model::FIXES[1], '\1_before_last_save') | |
| end | |
| end | |
| class Before < Struct.new(:text) | |
| def call | |
| text.gsub(Model::FIXES[0], 'will_save_change_to_\1?') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if [ "$#" -lt 2 ]; then | |
| echo "Usage: wait-for-it [host] [port] [timeout(optional)]" | |
| exit 1 | |
| fi | |
| host="$1" | |
| port="$2" | |
| timeout="${3:-0}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require 'uri' | |
| require 'delegate' | |
| class PG < SimpleDelegator | |
| FLAGS = ['--verbose', '--clean', '--no-owner', '--no-acl', '-j', '4'] | |
| def initialize(url) | |
| super URI.parse(url) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
| { | |
| "presets": [ | |
| "es2015" | |
| ], | |
| "plugins": [ | |
| "transform-decorators-legacy", | |
| "transform-class-properties" | |
| ] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'bundler/inline' | |
| require 'minitest/spec' | |
| require 'minitest/autorun' | |
| gemfile true do | |
| source 'https://rubygems.org' | |
| gem 'activerecord', '4.2.6', require: false | |
| gem 'sqlite3' | |
| gem 'squeel', '1.2.3', require: false | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'bundler/inline' | |
| require 'minitest/spec' | |
| require 'minitest/autorun' | |
| gemfile true do | |
| source 'https://rubygems.org' | |
| gem 'activerecord', '~> 5.0.0' | |
| gem 'sqlite3' | |
| gem 'baby_squeel', github: 'rzane/baby_squeel' | |
| end |