Skip to content

Instantly share code, notes, and snippets.


Matt Bower webbower

View GitHub Profile
webbower / hooks.js
Created Aug 4, 2020
Useful custom hooks
View hooks.js
const useConstant = value => useState(value)[0];
View rally-btree-serialize-post-interview.js
// NOTE Rado, Yi: I took the code where I left off and got it working in this second Gist file. It's probably not
// the most elegant solution, but it works. The code as of the end of the interview is in the other Gist.
// Given a binary tree, how would you serialize it into a string?
//Example input
var input = {
value: "a",
left: {
webbower / interview.css
Last active Jul 7, 2020
Interviewing utilities
View interview.css
html {
box-sizing: border-box;
*:after {
box-sizing: inherit;
webbower / ducks-module-tmpl.js
Last active May 4, 2020
Template for a Redux Ducks module
View ducks-module-tmpl.js
const prop = key => obj => obj[key];
// Action Types
const MY_ACTION = '{my}-app/{module}/MY_ACTION';
// Action Creators
export const myAction = (value) => ({
type: MY_ACTION,
payload: value,
View a11y.html
<html lang="en">
<meta charset="UTF-8">
<title>a11y for HTML</title>
* Visually hide an element, but leave it available for screen readers
* @link
* @link
webbower / package.json
Last active May 1, 2020
Simple, composable, instanced-enabled model factories
View package.json
"name": "simple-model",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {},
"scripts": {
"start": "watch 'yarn run test' src",
"test": "tape -r esm src/*.test.js"
webbower / extract-error-data.js
Created Nov 9, 2019
Extract data from error objects for serialization since Error instances are weirdly finicky and not straightforward to pull data from
View extract-error-data.js
const builtInErrorTypes = [
webbower / asciimoji.txt
Last active Aug 9, 2019
ASCII Emoji Reference
View asciimoji.txt
Shrug ¯\_(ツ)_/¯
Googley shrug ¯\(º_o)/¯
Flip all tables ┻━┻ ︵ヽ(`Д´)ノ︵ ┻━┻
Reset table ┬─┬ ノ( ゜-゜ノ)
Cthulhu /|\(;,;)/|\
webbower /
Created Feb 5, 2019
Bash command to get a line from a file
function line() {
sed "${1}q;d" "$2"
webbower / include-once.scss
Created Dec 19, 2018 — forked from StefanoRausch/include-once.scss
Import Once Feature Implemented in Sass.
View include-once.scss
$is-included : () !default;
@mixin once( $name ) {
@if include-once( $name ) {
@function include-once( $name ) {
@if index( $is-included, $name ) {
You can’t perform that action at this time.