- traverse each top-level thing, depth-first. for fragments, build a stack of "spread" references to be executed later 1a. so first it gets the query operation, then the F0, F1, etc 1b. each top-level object (operation, fragment) has a tree of nodes with "selections"
- when it starts processing fragments, it hits a lazy reducer which enumerates all of the schema types / interfaces (FragmentWithTypeStrategy) 2a. when it enters visiting a FragmentDefinition, it pushes it on the fragments stack
- when it gets to a Field under a fragment, the Node:Field.enter visitor looks up that field from the parent irep node or else creates a new irep node. it pushes it on the @nodes stack, and pushes empty parent directives? is that right? at this point, the Field AST node has directives as child AST nodes, which get traversed next
- when it visits the Directive AST node, it makes an irep node and pushes it on the @parent_nodes stack
- Arguments are children of the Directive AST, which is visited next. things unwind. ba
This file contains 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 node | |
console.log((new Date().getHours()) < 12 ? 'buenos!' : 'buenas!') |
This file contains 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 node | |
console.log((new Date().getHours()) < 12 ? 'buenos!' : 'buenas!') |
This file contains 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/sh | |
# Redirect output to stderr. | |
exec 1>&2 | |
changed=$(git diff --cached --name-only) | |
if echo $changed | grep '.js$'; then | |
prettier --list-different --no-semi --single-quote --trailing-comma=none --print-width=80 $changed || echo you cant go out looking like this! 💅 ; exit 1 | |
fi |
This file contains 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
// @flow | |
export type Locale = | |
| 'EN-us' | |
| 'ES-us' | |
export default class Foo { | |
name: string | |
constructor (name: string) { |
This file contains 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
.pl-c { | |
color: #969896 | |
} | |
.pl-c1,.pl-s .pl-v { | |
color: #0086b3 | |
} | |
.pl-e,.pl-en { | |
color: #795da3 |
This file contains 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
if (window.requestAnimationFrame) { | |
function checkForJank () { // eslint-disable-line no-inner-delcarations | |
const frameStart = Date.now() | |
window.requestAnimationFrame(() => { | |
const frameDuration = Date.now() - frameStart | |
if (frameDuration > 17) { | |
Perf.log(FirstJank) | |
} else { | |
checkForJank() | |
} |
This file contains 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
# Monkeypatch Selenium Webdriver to work on Travis IPv6 infrastructure | |
module Selenium | |
module WebDriver | |
class PortProber | |
IGNORED_ERRORS = [Errno::EADDRNOTAVAIL, Errno::EINVAL, Errno::EACCES].freeze | |
IGNORED_ERRORS << Errno::EBADF if Platform.cygwin? | |
def self.free?(port) | |
interfaces = Socket.getaddrinfo('localhost', 8080).map { |e| e[3] } | |
interfaces.each do |host| |
This file contains 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
rbenv install | |
gem install bundler | |
bundle install | |
# bootstrap all the things |
This file contains 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
<blink>im being held in san francisco working on legacy rails apps against my will</blink> |