Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Learning Ethereum & DeFi

Dawson Botsford dawsbot

💭
Learning Ethereum & DeFi
View GitHub Profile
View download-all-syntax-episodes.sh
#!/bin/bash
# Wget's all episodes of the Syntax.fm podcast hosted by Wes Bos and Scott Tolinkski
# Fetch full episode list
curl https://syntax.fm/api/shows |
jq -c '.[] | {url: .url, number: .number, title: .title, displayDate: .displayDate}' |
while read row; do
url=$(echo $row | jq -r '.url')
number=$(echo $row | jq -r '.number')
View vscode-insiders-syntax-breaker.tsx
import Skeleton from 'antd/lib/skeleton';
import * as React from 'react';
import InfiniteScroll from 'react-infinite-scroll-component';
import { defineMessages, FormattedMessage as FM } from 'react-intl';
import { connect } from 'react-redux';
import { bindActionCreators, Dispatch } from 'redux';
import styled from '@emotion/styled';
import { ActivityActions } from '../../actions/activities';
import { ArticleActions } from '../../actions/articles';
import { ProfilesActions } from '../../actions/profiles';
View keybase.md

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@dawsbot
dawsbot / image-minifier.sh
Last active Dec 20, 2019
Lossless image compression for all images in current directory
View image-minifier.sh
#!/bin/bash
# Minify all jpg and png images in current directory recursively
command_exists () {
type "$1" &> /dev/null ;
}
# Learn more about optipng at http://sweetme.at/2013/09/11/how-to-maximize-png-image-compression-with-optipng/
if command_exists optipng ; then
optipng -o2 -strip all **/*.png
else
@dawsbot
dawsbot / add-eslint.sh
Last active Mar 24, 2017
Add uber eslint to a project (assumes you don't have a `.eslintrc` to begin)
View add-eslint.sh
#!/bin/bash
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
dawsbot / curl.js
Last active Mar 23, 2017
es6AF way to curl to tempfile
View curl.js
const url = 'https://google.com';
const pify = require('pify');
const fs = pify(require('fs'));
const fetch = require('node-fetch');
const tempfile = require('tempfile');
const curl = (package, version) => {
fetch(url)
.then(res => res.text())
@dawsbot
dawsbot / addOwners.sh
Created Dec 14, 2016
Give npm owner permissions to a team of people instantly
View addOwners.sh
#!/bin/bash
users=(npmusername1 npmusername2 npmusername3)
for user in "${users[@]}"
do
npm owner add "$user"
done
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;
}