Skip to content

Instantly share code, notes, and snippets.


Chris O'Donnell codfish

View GitHub Profile
codfish /
Last active Oct 18, 2021
Prettier + ESLint + airbnb + Husky + lint-staged + commitlint

My personal & professional linting setup. Extends airbnb's ESLint config first, then Prettier. Run's Prettier as an ESLint rule via their ESLint plugin. Dynamic support for react or non-react applications depending on your project dependencies. Dynamic inclusion of Kent C Dodds' ESLint Jest config depending on your project dependencies.

Convenient opt-in configs for projects using Docker or Ethereum to avoid common false positives.

To understand more, see

To avoid having to manually setup everything and add all configuration/boilerplate code to your project, use cod-scripts instead. It was forked from kcd-scripts and ultimately inspired by react-scripts.


codfish / Module.jsx
Last active Apr 30, 2021
React Module component with context
View Module.jsx
import React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import styles from './';
import { Provider } from '../context/module';
const Module = ({ expandable, closed, children, className: classNameProp, ...other }) => {
const className = clsx(styles.root, classNameProp);
return (
codfish /
Last active Apr 21, 2021
Dev Resources & Reference

Here are some sites with useful developer tools & reference material. Some of them are simple links to the original source, while some are also elaborated on below for quick & helpful reference.

  • Fauna: The database built for serverless, featuring native GraphQL -- Source
  • Upstash: Another database service built for serverless, specifically focused on Redis, but also featuring GraphQL -- Source
  • Cloudinary: Store, transform, optimize, and deliver all your media assets with easy-to-use APIs, widgets, or user interface. -- Source
  • Safe Email Testing for Staging & Development. -- Source
  • k6: Open source load testing tool and SaaS for engineering teams. -- Source
  • Algolia: Rapidly create and scale AI-powered search and discovery across websites and applications. Algolia is fast, customizable and secure. -- Source
  • **S
codfish / .php_cs.dist
Last active Feb 25, 2021
PHP-CS-Fixer configuration file. PSR-2 plus some opinionated options to make code cleaner.
View .php_cs.dist
* Rules we follow are from PSR-2 as well as the rectified PSR-2 guide.
* -
* -
* -
* If something isn't addressed in either of those, some other common community rules are
codfish / now-headers.json
Last active Nov 13, 2020
Cache control headers for static assets with Now.
View now-headers.json
"version": 2,
"name": "",
"alias": "",
"builds": [{ "src": "package.json", "use": "@now/static-build" }],
"routes": [
"src": ".*\\.(js|css|jpg|jpeg|gif|png|svg|txt|ttf|woff2|webmanifest)$",
"headers": {
"Cache-Control": "public, max-age=157680000, s-maxage=157680000"
codfish / rsaa-cache-middleware.js
Last active Apr 20, 2020
Dynamic RSAA (redux-api-middleware) cache middleware. Must come before rssa in middleware order.
View rsaa-cache-middleware.js
import { RSAA } from 'redux-api-middleware';
import get from 'lodash/get';
* Intercept redux api middleware actions and bailout of api resource requests
* if the resource is already in the store.
* NOTE: State always gets updated on non-GET requests, essentially updating our "cache"
* Examples of resource routes that we want to cache:
codfish / roman-to-decimal.js
Created Apr 13, 2020
Convert decimal number to Roman numeral
View roman-to-decimal.js
const NUMERALS = {
I: 1,
V: 5,
X: 10,
L: 50,
C: 100,
D: 500,
M: 1000,
IV: 4,
IX: 9,
codfish /
Last active Jan 26, 2020
GIT Cheat Sheet & Reference

GIT Cheat Sheet & Reference

Here's some helpful git examples and reference for everyday issues.

# set new remote url
git remote set-url origin <remote_git_url>

# Update the latest commit
git commit --amend
xcode-select --install
cat ~/.ssh/ | pbcopy
# -> add ssh key to github
git clone ~/.dotfiles
sh ~/.dotfiles/bin/dotfiles --with-apps
# -> open google backup and sync and log in
sh Google\ Drive/.configfiles/bin/setup
codfish / meta-service.js
Created Sep 16, 2019
AngularJS v1 Meta Service
View meta-service.js
// ***********************************************************************************
// meta-service.js
'use strict';
* Meta Service
* The Meta Service allows you to abstract a lot of business logic
* that goes into setting meta & link tags for your templates.