Skip to content

Instantly share code, notes, and snippets.

View dawsbot's full-sized avatar
💭
Bringing web3 to emerging markets - web3perf

Dawson Botsford dawsbot

💭
Bringing web3 to emerging markets - web3perf
View GitHub Profile

0x1396062f8b786433f1d40a4b41d46011487754050edb3e3c83372b234b4611f9

@dawsbot
dawsbot / charm.abi.js
Last active January 26, 2022 21:46
JSON ABI for FTM Charm Token (team has not verified on-chain, so you'll need this to interact with the contract)
// ABI for https://ftmscan.com/address/0xa320ae264278476be187468ff38e4f6b883b3b92#code
[
{
inputs: [
{
internalType: "address",
name: "_authority",
type: "address",
},
{
#!/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')
@dawsbot
dawsbot / vscode-insiders-syntax-breaker.tsx
Created March 22, 2020 14:42
Breaks vscode insiders syntax highlighting in relation to https://github.com/microsoft/vscode/issues/92308
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';
@dawsbot
dawsbot / image-minifier.sh
Last active December 20, 2019 16:40
Lossless image compression for all images in current directory
#!/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

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@dawsbot
dawsbot / 5to6-exports.js
Last active January 12, 2019 13:36
jscodeshift mod
'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: [
j.AssignmentExpression
@dawsbot
dawsbot / add-eslint.sh
Last active March 24, 2017 19:16
Add uber eslint to a project (assumes you don't have a `.eslintrc` to begin)
#!/bin/bash
yarn add eslint eslint-config-uber-es2015
echo '{\n "extends": ["eslint-config-uber-es2015"]\n}' > .eslintrc
const tmpDir = path.join(os.tmpdir(), Math.random().toString().slice(8), basename);
@dawsbot
dawsbot / curl.js
Last active March 23, 2017 22:32
es6AF way to curl to tempfile
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())