Skip to content

Instantly share code, notes, and snippets.

View whatl3y's full-sized avatar

Lance Whatley whatl3y

View GitHub Profile
@whatl3y
whatl3y / arbAirdropCheck.ts
Created September 22, 2023 18:23
Arbitrum Airdrop Wallet Check - checks and displays eligibility and claimable amount for 300 wallets in a seed phrase
import assert from 'assert'
import BigNumber from 'bignumber.js'
import dotenv from 'dotenv'
import Web3 from 'web3'
import { Wallet } from 'ethers'
import {
Multicall,
ContractCallResults,
ContractCallContext,
} from 'ethereum-multicall'
@whatl3y
whatl3y / etherscanTsParse.ts
Created July 25, 2021 09:48
Parse a timestamp as provided by an etherscan transaction hash
import dayjs from 'dayjs'
dayjs('Jul-24-2021 00:00:00 PM +00:00', 'MMM-D-YYYY hh:mm:ss A Z')
# Get the price of an ERC20 token based on it's ticker symbol
# Dependencies: curl, jq
# Desired usage:
# $ price hyve
# $ price cnfi
# $ price cudos
# $ price albt
function price() {
id=$(curl -s "https://api.coingecko.com/api/v3/coins/list" -H "accept: application/json" | jq --arg sym "$1" '.[] | select(.symbol==$sym)' | jq .id)
id_no_quotes=${id//$'"'/}

Keybase proof

I hereby claim:

  • I am whatl3y on github.
  • I am whatl3y (https://keybase.io/whatl3y) on keybase.
  • I have a public key ASA33rnYykbw7GlP7l9zpLK5qLMic4qg6ZP7HzUjIGVd9wo

To claim this, I am signing this object:

import moment from 'moment'
export default {
parse(dueDateProvided, remainingFormats=Object.keys(this.formats)) {
if (remainingFormats.length === 0)
return null
const [ format ] = remainingFormats.splice(0, 1)
if (typeof dueDateProvided === 'string' && !this.formats[format].regexp.test(dueDateProvided))
return this.parse(dueDateProvided, remainingFormats)
<template lang="pug">
quill-editor(v-model="dynamicValue",:options="editorSettings",@change="textChange")
</template>
<script>
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
import Quill from 'quill'
@whatl3y
whatl3y / perfectCircle.js
Created April 9, 2019 19:17
Programmatically draw perfect circles on the following page: http://vladgotlib.com/circular
var perfection = {
pointsToDraw: 8000,
radius: 600,
x: 800,
y: 650,
go() {
this.startDraw(this.x, this.y);
this.drawCircle((xStep, yStep) => {
this.drawPoints(this.x + (xStep * this.radius), this.y + (yStep * this.radius))
@whatl3y
whatl3y / isPortTaken.js
Last active December 5, 2019 15:13 — forked from timoxley/isPortTaken.js
check if a port is being used with nodejs
const net = require('net')
function isPortTaken(port) {
return new Promise((resolve, reject) => {
const tester = net.createServer()
tester.once('error', err => {
if (err.code != 'EADDRINUSE')
return reject(err)
resolve(true)
})