Skip to content

Instantly share code, notes, and snippets.

@AsaAyers
AsaAyers / REMIX.md
Created August 16, 2021 05:29
Created from Remix Form!

now with usePendingFormSubmit()

@AsaAyers
AsaAyers / Remix test gist
Created August 16, 2021 05:13
Created from Remix Form!
Hello Remix!
<form>! Hello old friend! I haven't seen you in a long time.
@AsaAyers
AsaAyers / inline-tools.js
Last active December 5, 2018 20:58
js console tools
/* eslint-disable func-names, no-plusplus, babel/semi, arrow-parens, no-ternary, no-undefined */
/* eslint semi: ["error", "never"] */
/* global inlineTools:true, copy */
inlineTools = (function () {
const replacer = (c) => `-${c.toLowerCase()}`
const toCSSProperty = (property) => property.replace(/[A-Z]/g, replacer)
.replace(/^webkit/, '-webkit')
@AsaAyers
AsaAyers / CleanBranches.sh
Last active June 2, 2021 15:03
Script for cleaning up merged branches
#!/bin/bash
# This script was written with the following assumptions:
# * you have two remotes: `upstream` and `origin`.
# * you only ever push to `origin`
# For most projects this would be master, but dev is our main branch
DEFAULT_BRANCH="dev"
import React from 'react'
import { Match } from 'react-router'
// example:
// <MatchWithTransforms
// transforms={{ id: Number }}
// pattern="/page/:id"
// component={ViewPage} />
const MatchWithTransforms = ({ transforms, ...matchProps}) => {
@AsaAyers
AsaAyers / you_dont_need_coffeescript.md
Created September 20, 2016 15:52
You Don't Need CoffeeScript

You Don't Need CoffeeScript

It's time to replace CoffeeScript with Babel and CoffeeLint with eslint.

CoffeeScript was useful a few years ago. It provided many features that JavaScript was lacking. It gave us the fat arrow (lexical this functions), default parameters, destructuring assignments, splats (spread operator), a class keyword, block strings, and more. Everything in the list above is now part of the JavaScript standard. JavaScript is moving forward and gaining

// This was written using gists editor. I hope I have the syntax right.
function HOCAutoSizer(ChildComponent) {
return function(props) { // Stateless component
return (
<AutoSizer>
{({ height, width }) => (
<ChildComponent
width={width}
height={height}
@AsaAyers
AsaAyers / keybase.md
Created November 18, 2015 23:08
keybase.md

Keybase proof

I hereby claim:

  • I am asaayers on github.
  • I am asaayers (https://keybase.io/asaayers) on keybase.
  • I have a public key is ASA-KrZq2n-UzkQ7If6W6JZhW2GHHBNiK8J0bXyg6INuMwo

To claim this, I am signing this object:

const someObject = {
a: "Some Value"
// ^ Input
// ^ Output: someObject.a
}
const { a: a } = someObject
// ^ Output: `const a`
// ^ Input: someObject.a
@AsaAyers
AsaAyers / coffeelint.json
Last active August 29, 2015 14:21
`full_coffeelint.json` is what you would get if you run `--makeconfig` and configure it to match the coffee-lint repo's rules. `coffeelint.json` is the same file run through `--trimconfig`
{
"arrow_spacing": {
"level": "error"
},
"cyclomatic_complexity": {
"value": 11,
"level": "warn"
},
"indentation": {
"value": 4