Skip to content

Instantly share code, notes, and snippets.

@johnthepink
johnthepink / gifs.sh
Created January 18, 2022 16:03
Creating Gifs on OSX
# dependencies to install
brew install ffmpeg
brew install gifsicle
# add this to your shell environment
function v2g() {
ffmpeg -i "$1" -pix_fmt rgb8 -r 10 "$2" && gifsicle -O3 "$2" -o "$2"
}
# record a screencast with Quick Player
@johnthepink
johnthepink / benchmark.rb
Last active November 28, 2018 18:58
Ruby String Matching Benchmark
require 'benchmark'
require 'securerandom'
words = []
# generate list of random "words"
10_000.times.map do
words << SecureRandom.hex
end
@johnthepink
johnthepink / colors.md
Last active April 11, 2019 04:49
Terminal Palette

Terminal Palette Colors

#3C4C55 #899BA6

#DF8C8C #F2C38F

#A8CE93 #A8CE93

<item>
<title />
<description>
Fifty-nine passengers and four crew members safely evacuated a United Express flight after the engine burst into flames.&lt;div class="feedflare"&gt;
&lt;a href="http://rss.cnn.com/~ff/rss/cnn_travel?a=H995_4vxihE:2pGC83WfmKU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/rss/cnn_travel?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://rss.cnn.com/~ff/rss/cnn_travel?a=H995_4vxihE:2pGC83WfmKU:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/rss/cnn_travel?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://rss.cnn.com/~ff/rss/cnn_travel?a=H995_4vxihE:2pGC83WfmKU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/rss/cnn_travel?i=H995_4vxihE:2pGC83WfmKU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://rss.cnn.com/~ff/rss/cnn_travel?a=H995_4vxihE:2pGC83WfmKU:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/rss/cnn_travel?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a

Drum Talk: Playing the Right Note

About Yourself

  • little about myself
  • little about yourself

Intro

It's not the notes you play, it's the notes you don't play. - Miles Davis

import { shallow } from "enzyme";
import { shallowToJson } from "enzyme-to-json";
import Layout from "../Layout";
const defaultProps = {
schedule: {
start: "2012-12-12",
details: [
{
amount: 2,
@johnthepink
johnthepink / example.js
Created November 15, 2016 17:07
Mocking Mixin Class Methods
const MockHeaderAction = (Component) => (
class MockHeaderAction extends React.Component {
constructor () {
super(...arguments);
this.headerAction = jest.fn();
}
render() {
return <Component { ...this.props } { ...this.state } />
}
}
// Removing Decorators
//
// Flow does not currently understand decorators. Also, removing the decorators
// sets us up to easily export things without data for testing.
// Current Pattern
@connect(mapStateToProps)
@withSavedPayments
export default class CheckoutButtons extends Component {
// psuedo code
class MessageForm extends React.Component {
onSubmit = (e) => {
// POST the new message
}
render() {
return (
<form onSubmit={this.onSubmit}>

Holtzmann Training

Overview

Install Holtzmann

  • nvm/node
  • run project

Explain overall reasoning