Skip to content

Instantly share code, notes, and snippets.

View indiesquidge's full-sized avatar

Austin Wood indiesquidge

View GitHub Profile
@JoshCheek
JoshCheek / happy
Created February 4, 2016 14:50
Student syntaxes for JSON data structures!
Happy!
======
Personified syntax
nil = #
hash = @ key*value @
string = :delimiters)
boolean = true S, false$ , %% and ^^or
integer = V1 V2 all have Vs in front
@ericelliott
ericelliott / script.js
Last active May 14, 2016 02:33
bdMjmE
import test from 'tape';
test('A passing test', (assert) => {
assert.pass('This test will pass.');
assert.end();
});
test('Assertions with tape.', (assert) => {
@ericelliott
ericelliott / blue-tape-api.js
Created July 11, 2015 20:03
blue-tape Promise API
test('Greet World', (assert) => new Promise((resolve) => {
assert.equal(hello('World'), 'Hello, World!');
setTimeout(() => {
// do some async stuff
resolve();
}, 10);
}));
const config = require('./config');
const fetch = require('node-fetch');
const querystring = require('querystring');
module.exports = {
get,
post,
put,
delete: httpDelete, // function name can't be 'delete'
fetchJsonWithAuth,
@alanbsmith
alanbsmith / buttermilk-pancake-recipe.md
Created April 6, 2018 20:27
My Buttermilk Pancake Recipe 🥞🥞🥞

BUTTERMILK PANCAKES 🥞

OVERVIEW

This recipe is loosely adapted from this NYT recipe. They come out super fluffy. It also works great for waffles. I make my own buttermilk with whole milk and white vinegar, which I'll describe below.

YIELD

~8 pancakes

@scwood
scwood / attemptWithRetry.js
Last active October 4, 2018 05:42
Exponential backoff retry logic for a function that returns a Promise
/**
* Retries a function that returns a promise a given number of times and backs
* off each attempt exponentially.
*
* @param {Function} promiseGenerator The function to retry.
* @param {number} [attempts=5] Number of attempts to make.
* @param {number} [delay=1000] Initial delay between attempts in ms.
* @return {Promise}
*/
function attemptWithRetry(promiseGenerator, attempts = 5, delay = 100) {
@JoshCheek
JoshCheek / 1503_object_model_notes.md
Last active December 18, 2018 16:53
Object Model Notes for 1503

Object Model

Bindings

  • are nodes in the stack
  • store local_variables
  • have a return value
  • have a self
import test from 'tape';
const before = test;
const after = test;
// beforeEach/afterEach rely on shared state.
// That's a big anti-pattern for testing.
// It's also silly to run something before and after
// ever test -- many of your tests won't need it.
@kiliman
kiliman / LiveReload.tsx
Last active January 19, 2022 15:44
Remix Run and Tailwind CSS config with jit support
export default function () {
return process.env.NODE_ENV === 'development' ? (
<script src="http://localhost:35729/livereload.js?snipver=1"></script>
) : null
}
@olivierlacan
olivierlacan / migrate_postgresql_database.md
Last active March 24, 2022 20:30
How to migrate a Homebrew-installed PostgreSQL database to a new major version (9.3 to 9.4) on OS X. See upgraded version of this guide: http://olivierlacan.com/posts/migrating-homebrew-postgres-to-a-new-version/

This guide assumes that you recently run brew upgrade postgresql and discovered to your dismay that you accidentally bumped from one major version to another: say 9.3.x to 9.4.x. Yes, that is a major version bump in PG land.

First let's check something.

brew info postgresql

The top of what gets printed as a result is the most important: