This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fd json abi | xargs -n1 jq '.[] | select(.type=="event") | select( any(.inputs[]; .name == "tokenId")) | .name+"("+(.inputs|map(.type)|join(","))+")"' | sort | uniq | parallel 'echo {}; echo -n {} | keccak-256sum' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mix.install([:jason]) | |
attribute_order = ["background", "body", "tattoos", "costume", "mane", "face", "eyes", "snout", "hat", "flinger"] | |
File.cd("tokens") | |
File.ls!() | |
|> Enum.filter(&(&1 =~ ".json")) | |
|> Enum.sort_by(&Float.parse/1) | |
|> Enum.map(fn f -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mix.install([ | |
{:ethereumex, "~> 0.7.0"}, | |
{:ex_abi, "~> 0.5.2"}, | |
{:ex_keccak, path: "../ex_keccak", override: true} # fixed a bug locally | |
]) | |
# Application.put_env(:ethereumex, :url, "https://polygon-rpc.com/") | |
Application.put_env(:ethereumex, :url, "https://rpc-mumbai.matic.today") | |
defmodule MeetingScheduler do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Extract the environment variables from a deis app and convert them to a standard env file format | |
namespace=$1 | |
pod=$2 | |
kubectl get pod $pod -o json -n $namespace | jq -r '.spec.containers[].env[]? | [.name, .valueFrom.secretKeyRef.name, .valueFrom.secretKeyRef.key] | @tsv' | \ | |
grep -v -e "^WORKFLOW_RELEASE" -e "^PORT" -e "^SOURCE_VERSION" -e "^DEIS_APP" -e "^DATABASE_URL" | \ | |
while IFS=$'\t' read -r var_name secret_name secret_key; do | |
kubectl get secret $secret_name --namespace $namespace -o json | jq -r --arg var_name "$var_name" --arg secret_key $secret_key '.data[$secret_key] | @base64d | "\($var_name)=\"\(.)\""' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cask_args appdir: '/Applications' | |
tap 'homebrew/cask' | |
tap 'homebrew/bundle' | |
tap 'heroku/brew' | |
brew 'asdf' | |
brew 'bash' | |
brew 'bat' | |
brew 'coreutils' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Get the sum of the duration of all builds on a specific day for a list of repos | |
# | |
# example: | |
# $ sh travis_seconds.sh | |
# 2020-08-06 | |
# 47014 | |
# | |
# repos (org/repo) are in repos.txt, 1 per line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Plug.DebugHTTPHeaders do | |
@moduledoc """ | |
Plug to debug request and response headers. Add it to TSSWeb.Endpoint before | |
any other plugs to ensure you see all headers. If you add it to the router | |
another plug might handle the response before this one. | |
THIS IS MEANT FOR USE IN DEVELOPMENT ONLY. | |
If you see this plug used in a pull request, reject it. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Mix.Tasks.Compile.Notifications do | |
@moduledoc """ | |
Send notifications when compiling is done | |
Uses a GenServer to limit the number of notifications it sends to one every | |
@notification_timeout_ms milliseconds. This is because phoenix checks if any | |
files need to be compiled on every request. | |
Setup: | |
* Put this in lib/mix/tasks/compile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IEx.configure(default_prompt: "%prefix>", alive_prompt: "%node>") | |
pbcopy = fn arg -> | |
port = Port.open({:spawn_executable, "/usr/bin/pbcopy"}, []) | |
Port.command(port, arg) | |
Port.close(port) | |
arg | |
end | |
pbpaste = fn -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am lukeledet on github. | |
* I am lukeledet (https://keybase.io/lukeledet) on keybase. | |
* I have a public key ASAq37AsIe3VPgfrsVdysYG5l1ZDX0Eq4THnSNpL100rVgo | |
To claim this, I am signing this object: |
NewerOlder