Skip to content

Instantly share code, notes, and snippets.

Aaron Scherer aequasi

Block or report user

Report or block aequasi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View next.config.js
const {ContextReplacementPlugin} = require('webpack');
const {join} = require('path');
require('dotenv').config({path: join(__dirname, '')});
const withImages = require('next-images');
const withSass = require('@zeit/next-sass');
const withSourcemaps = require('@zeit/next-source-maps')();
const isProd = process.env.NODE_ENV === 'production';
const ident = isProd ? '[hash:base64:5]_[local:base64:5]' : '[name]_[local]';

Keybase proof

I hereby claim:

  • I am aequasi on github.
  • I am aequasi ( on keybase.
  • I have a public key ASBhuAwo0Ek_FCTtgCssp1I8EiLEikCciABqxH31IFnsXQo

To claim this, I am signing this object:

aequasi / AuthContext.tsx
Created May 16, 2019
Complex useContext Example (+useReducer)
View AuthContext.tsx
import {createContext, Dispatchm useReducer} from 'react';
import User from '../model/User';
interface State {
user?: User;
specialAwesomeFeature: boolean;
type Action =
aequasi / AuthContext.tsx
Last active May 16, 2019
Simple useContext example (+ useState)
View AuthContext.tsx
import {createContext, useState} from 'react';
import User from '../model/User'; // Random User Model
interface Context {
user?: User;
setUser?: (user: User) => void;
const initialState: User = null;
View AbstractFields.tsx
type newable<T> = new (cls: newable<T>) => T;
export default abstract class AbstractFields<T extends AbstractFields<any>> {
protected constructor(protected readonly cls: newable<T>) {
public with(property: keyof T & string, value: string | number): T {
const newInstance: T = new this.cls(this.cls);
for (const [k, v] of Object.entries(this)) {
View gist:5eba0163fe411a019b807bdbc530f9ec
"log": {
"version": "1.2",
"creator": {
"name": "WebInspector",
"version": "537.36"
"pages": [
"startedDateTime": "2018-12-01T05:42:24.899Z",
View log
This file has been truncated, but you can view the full file.
2018/11/21 01:01:52 [WARN] Invalid log level: "1". Defaulting to level: TRACE. Valid levels are: [TRACE DEBUG INFO WARN ERROR]
2018/11/21 01:01:52 [INFO] Terraform version: 0.11.10 17850e9a55d33c43d7c31fd6ac122ba97a51d899
2018/11/21 01:01:52 [INFO] Go runtime version: go1.11.1
2018/11/21 01:01:52 [INFO] CLI args: []string{"/usr/local/bin/terraform", "apply"}
2018/11/21 01:01:52 [DEBUG] Attempting to open CLI config file: /Users/aaron/.terraformrc
2018/11/21 01:01:52 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2018/11/21 01:01:52 [INFO] CLI command args: []string{"apply"}
2018/11/21 01:01:52 [TRACE] module source: ""
2018/11/21 01:01:52 [TRACE] module source: ""
aequasi / git.bash
Created Oct 16, 2018
Handy git functions
View git.bash
pull() {
git pull ${1:-origin} ${2:-HEAD}
push() {
git push ${1:-origin} ${2:-HEAD}
aequasi / afssh
Last active May 22, 2018
Allows for SSHing (with tunnels) to any of the ansible inventories
View afssh
if [[ "$2" != "dbservers" && "$2" != "webservers" ]]; then
echo ""
echo "$2 is not a valid type. Pass either dbservers or webservers"
View ChannelBuffer.ts
import {Mutex} from "await-semaphore";
import {Channel} from "eris";
import {setInterval} from "timers";
const mutex: Mutex = new Mutex();
export default class ChannelBuffer<T> {
private _messages: T[] = [];
constructor(private _channel: Channel, tick: Function, interval: number = 1000) {
You can’t perform that action at this time.