Skip to content

Instantly share code, notes, and snippets.

View nwalters512's full-sized avatar

Nathan Sarang-Walters nwalters512

View GitHub Profile
@nwalters512
nwalters512 / HTTPCache.ts
Created June 23, 2020 20:12
apollo-datasource-rest cache status
/* eslint-disable no-underscore-dangle, no-param-reassign */
/**
* This file is largely a direct copy of `HTTPCache.ts` from the `apollo-datasource-rest` package
* (https://github.com/apollographql/apollo-server/blob/136a25e89b5f7e55c465b5d657fe735e33a0017f/packages/apollo-datasource-rest/src/HTTPCache.ts).
* The primary modification is to the `fetch` function, which now provides metadata about
* whether the request was a cache hit or miss. Those changes can be seen in this commit:
* https://github.com/NerdWallet/query0/commit/064e7b2b5c1a7235618042e5dbabd94447cdb67b.
*/
id: 2018.07.20-react-16
title: Update all packages to be React 16 compatible
adapter:
type: github
search_query: org:NerdWallet path:/ filename:package.json react
hooks:
should_migrate:
- node $SHEPHERD_MIGRATION_DIR/should_migrate.js
- git log -1 --format=%cd | grep 2018 --silent # Only migrate things that have seen commits in 2018
apply:
shepherd checkout ./eslint-migration
shepherd apply ./eslint-migration
shepherd commit ./eslint-migration
shepherd push ./eslint-migration
shepherd pr ./eslint-migration
id: 2018.07.16-eslintrc-yml
title: Rename all .eslintrc files to .eslintrc.yml
adapter:
type: github
search_query: org:NerdWallet path:/ filename:.eslintrc
hooks:
should_migrate:
- ls .eslintrc
- git log -1 --format=%cd | grep 2018 --silent
apply: mv .eslintrc .eslintrc.yml
-- BLOCK select_course_info
WITH
select_course_users AS (
SELECT
coalesce(jsonb_agg(jsonb_build_object(
'user_id', u.user_id,
'uid', u.uid,
'name', u.name,
'course_role', cp.course_role
) ORDER BY u.uid, u.user_id), '[]'::jsonb) AS course_users
{"frc1339":{"div":"Galileo","addr":"L22-SWAG"},"frc8":{"div":"Curie","addr":"F21"},"frc11":{"div":"Carson","addr":"K15"},"frc16":{"div":"Newton","addr":"A21"},"frc20":{"div":"Carver","addr":"F11"},"frc25":{"div":"Curie","addr":"F23"},"frc27":{"div":"Carver","addr":"F13"},"frc33":{"div":"Tesla","addr":"Q15"},"frc41":{"div":"Carson","addr":"K17"},"frc45":{"div":"Archimedes","addr":"Q21"},"frc48":{"div":"Newton","addr":"A23"},"frc51":{"div":"Carson","addr":"K19"},"frc57":{"div":"Carver","addr":"F15"},"frc60":{"div":"Carson","addr":"K06"},"frc66":{"div":"Tesla","addr":"Q17"},"frc67":{"div":"Newton","addr":"A25"},"frc68":{"div":"Galileo","addr":"K21"},"frc70":{"div":"Hopper","addr":"A03"},"frc74":{"div":"Tesla","addr":"Q19"},"frc78":{"div":"Carver","addr":"F17"},"frc85":{"div":"Carver","addr":"F19"},"frc88":{"div":"Galileo","addr":"K23"},"frc103":{"div":"Newton","addr":"A27"},"frc107":{"div":"Archimedes","addr":"Q23"},"frc111":{"div":"Tesla","addr":"Q16"},"frc118":{"div":"Newton","addr":"A29"},"frc120":{"div":"Car
@nwalters512
nwalters512 / alliances.txt
Last active August 29, 2015 14:19
2015 Champs Alliances
CSV, ordered as alliances 1-8, teams ordered in pick order
GALILEO ALLIANCES
2836,2067,2168,1
2056,330,492,3944
525,1595,2052,2990
3618,1619,967,3026
876,111,2451,3674
27,1690,384,3146
@nwalters512
nwalters512 / BufferedChildEventListener.java
Created April 18, 2015 00:39
A buffered wrapper for a Firebase ChildEventListener
package com.thebluealliance.androidclient.firebase;
import com.firebase.client.ChildEventListener;
import com.firebase.client.DataSnapshot;
import com.firebase.client.FirebaseError;
import java.util.ArrayList;
import java.util.List;
/**
@nwalters512
nwalters512 / colors.xml
Created November 6, 2014 04:10
tba-stackoverflow
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="light_red">#fdd</color>
<color name="lighter_red">#fee</color>
<color name="light_blue">#ddf</color>
<color name="lighter_blue">#eef</color>
<color name="blue">#00F</color>
<color name="red">#F00</color>
<color name="nav_divider">#ffc2c2c2</color>