Skip to content

Instantly share code, notes, and snippets.

@ariesshrimp
ariesshrimp / Contract Killer 3.md
Created December 11, 2017 22:07 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@ariesshrimp
ariesshrimp / symbols-as-props.js
Last active July 25, 2017 21:17
Use static symbols to gate arbitrary React props (as opposed to magic strings)
// to see it in action live, see https://goo.gl/EM9EPp
import {converge, objOf, toUpper, map, compose, reduce, merge, replace, toString, values} from 'ramda'
/**
* upperKey :: [string] -> [{STRING: string}]
* @example upperKey(arr) === [{A: 'a'}, {B: 'b'}, ...]
*/
const upperKey = converge(objOf, [toUpper, Symbol])
/**
@ariesshrimp
ariesshrimp / squash.sh
Last active July 24, 2017 22:10
Squash several Git commits into a single commit
# https://makandracards.com/makandra/527-squash-several-git-commits-into-a-single-commit
# Switch to the master branch and make sure you are up to date.
git checkout master
git fetch # this may be necessary (depending on your git config) to receive updates on origin/master
git pull
# Merge the feature branch into the master branch.
git merge feature_branch
# Reset the master branch to origin's state.
@ariesshrimp
ariesshrimp / real-world-ocaml-Dockerfile
Last active May 7, 2017 07:32
A Dockerfile for working through Real World Ocaml https://github.com/realworldocaml/book
# See https://hub.docker.com/r/ocaml/opam/
FROM ocaml/opam
# Get core set up
RUN opam depext -i core
# Do some extra stuff to make cryptokit happy
RUN opam depext conf-zlib.1 && opam depext conf-gmp.1 && opam install cryptokit
# Install all the packages the book uses, including the utop REPL
@ariesshrimp
ariesshrimp / animated-switch-example.js
Last active May 7, 2017 07:35
A working example of React Router 4's <Switch /> API using CSS Transition Group to animate content between routes.
import React from 'react'
import ReactCSSTransitionGroup from 'react-addons-css-transition-group'
import {
BrowserRouter as Router,
Route,
Link,
Switch
} from 'react-router-dom'
const BasicExample = () => (