Skip to content

Instantly share code, notes, and snippets.

Dawson Botsford dawsbot

Block or report user

Report or block dawsbot

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Keybase proof

I hereby claim:

To claim this, I am signing this object:

dawsbot /
Last active Dec 20, 2019
Lossless image compression for all images in current directory
# Minify all jpg and png images in current directory recursively
command_exists () {
type "$1" &> /dev/null ;
# Learn more about optipng at
if command_exists optipng ; then
optipng -o2 -strip all **/*.png
dawsbot /
Last active Mar 24, 2017
Add uber eslint to a project (assumes you don't have a `.eslintrc` to begin)
yarn add eslint eslint-config-uber-es2015
echo '{\n "extends": ["eslint-config-uber-es2015"]\n}' > .eslintrc
View RandomString.js
const tmpDir = path.join(os.tmpdir(), Math.random().toString().slice(8), basename);
dawsbot / curl.js
Last active Mar 23, 2017
es6AF way to curl to tempfile
View curl.js
const url = '';
const pify = require('pify');
const fs = pify(require('fs'));
const fetch = require('node-fetch');
const tempfile = require('tempfile');
const curl = (package, version) => {
.then(res => res.text())
dawsbot /
Created Dec 14, 2016
Give npm owner permissions to a team of people instantly
users=(npmusername1 npmusername2 npmusername3)
for user in "${users[@]}"
npm owner add "$user"
View facebook-button-v1.css
.facebook-button {
color: white;
background-color: rgb(66, 103, 178);
View facebook-button.css
.facebook-button {
color: white;
background-color: rgb(66, 103, 178);
border-color: rgb(66, 103, 178);
border-radius: 2px;
border-style: solid;
border-width: 1px;
padding: 0px 16px 0px 16px;
line-height: 22px;
dawsbot / reactComponentLifecycle.txt
Last active Sep 28, 2016
React component lifecycle
View reactComponentLifecycle.txt
* ------------------ The Life-Cycle of a Composite Component ------------------
* - constructor: Initialization of state. The instance is now retained.
* - componentWillMount
* - render
* - [children's constructors]
* - [children's componentWillMount and render]
* - [children's componentDidMount]
* - componentDidMount
dawsbot / 5to6-exports.js
Last active Jan 12, 2019
jscodeshift mod
View 5to6-exports.js
'use strict';
export default function transformer(file, api) {
const j = api.jscodeshift;
const {expression, statement, statements} = j.template;
const root = j(file.source);
return root
.find(j.Program, {
body: [
You can’t perform that action at this time.