Skip to content

Instantly share code, notes, and snippets.

Avatar

Matt Culpepper mculp

View GitHub Profile
@mculp
mculp / psqlrc
Last active May 23, 2022
psqlrc with aliases for index, slow queries, locks, etc
View psqlrc
--
-- save this as ~/.psqlrc
--
-- run an alias with :
--
-- e.g. :long_running_queries
\set QUIET 1
-- formatting
@mculp
mculp / oxd_LP.txt
Created Mar 10, 2022
0xDAO emissions / rewards
View oxd_LP.txt
************************ 1. row ************************
boost_solidex: 2.0928076186523006
oxdao_v2_rewards: 35145351973587244
oxdv2_boost: 1.5419483576059234
solid_rewards: 35145351973587244
symbol: vAMM-WFTM/OXD
tvl: 559990.86917331589706084137
************************ 2. row ************************
boost_solidex: 1.6251922186182624
oxdao_v2_rewards: 7491782393110821
@mculp
mculp / solidly-dot-dev-pairs.sh
Last active Mar 9, 2022
API for solidly.dev/pairs
View solidly-dot-dev-pairs.sh
curl 'https://api.thegraph.com/subgraphs/name/spartacus-finance/solidly' \
-H 'authority: api.thegraph.com' \
-H 'sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="99", "Google Chrome";v="99"' \
-H 'accept: */*' \
-H 'content-type: application/json' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36' \
-H 'sec-ch-ua-platform: "macOS"' \
-H 'origin: https://solidly.dev' \
-H 'sec-fetch-site: cross-site' \
View oxdao_pool_rates.rb
=> [{:symbol=>"vAMM-USDC/OXD", :reward_rates=>["803461050777566", "897985880280809"], :boost_oxdao=>2.5, :boost_solidex=>1.4918954102869841},
{:symbol=>"vAMM-WFTM/TOMB", :reward_rates=>["74694574843542", "83482171883959"], :boost_oxdao=>2.5, :boost_solidex=>1.530933128008952},
{:symbol=>"vAMM-BIFI/miMATIC", :reward_rates=>["5954162014826", "6654651663629"], :boost_oxdao=>2.5, :boost_solidex=>1.4924574268794457},
{:symbol=>"vAMM-WFTM/RDL", :reward_rates=>["484224024803996", "541191557133878"], :boost_oxdao=>2.5, :boost_solidex=>1.521362300792279},
{:symbol=>"sAMM-SOLIDsex/SOLID", :reward_rates=>["4667989419911", "5013706462294"], :boost_oxdao=>2.5, :boost_solidex=>1.4764777520376702},
{:symbol=>"vAMM-BOO/xBOO", :reward_rates=>["3903744445840575", "4363008498292408"], :boost_oxdao=>2.5, :boost_solidex=>1.5671872486016638},
{:symbol=>"vAMM-IB/WFTM", :reward_rates=>["331958051040", "371011939397"], :boost_oxdao=>2.5, :boost_solidex=>1.7462349371592305},
{:symbol=>"vAMM-YFI/WOOFY", :reward_rates=>["27669065
@mculp
mculp / oxdao.rb
Created Mar 9, 2022
quick script to find most profitable oxdao pools
View oxdao.rb
nonempty_pools = pools.select do |pool|
pool['rewardTokens'].any? &&
pool['totalTvlUsd'].to_i.nonzero? &&
pool['poolPrice'].to_i.nonzero?
end
boosted_pools = nonempty_pools.select do |p|
p['boostOxDao'] > 2.4 &&
p['boostSolidex'] > 1.6 &&
p.dig('poolData', 'price0Usd').nonzero? &&
@mculp
mculp / pre-commit
Last active Sep 18, 2020
run rubocop as a git precommit hook
View pre-commit
#!/bin/bash
files=$(git status -s | grep -E 'A|M' | awk '{print $2}')
files="$files $(git status -s | grep -E 'R' | awk '{print $4}')"
echo $files | xargs $(which rubocop) --display-cop-names --extra-details --parallel --force-exclusion
@mculp
mculp / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mculp
mculp / voices.txt
Created Dec 3, 2014
List of voices available by the `say` command on OS X
View voices.txt
Agnes en_US # Isn't it nice to have a computer that will talk to you?
Albert en_US # I have a frog in my throat. No, I mean a real frog!
Alex en_US # Most people recognize me by my voice.
Alice it_IT # Salve, mi chiamo Alice e sono una voce italiana.
Alva sv_SE # Hej, jag heter Alva. Jag är en svensk röst.
Amelie fr_CA # Bonjour, je m’appelle Amelie. Je suis une voix canadienne.
Anna de_DE # Hallo, ich heiße Anna und ich bin eine deutsche Stimme.
Bad News en_US # The light you see at the end of the tunnel is the headlamp of a fast approaching train.
Bahh en_US # Do not pull the wool over my eyes.
Bells en_US # Time flies when you are having fun.
@mculp
mculp / potcoin.json
Created May 2, 2014
potcoin peer nodes
View potcoin.json
[
{
"addr" : "107.170.32.10:4200",
"services" : "00000003",
"lastsend" : 1398995130,
"lastrecv" : 1398995130,
"bytessent" : 1085124,
"bytesrecv" : 2291856,
"blocksrequested" : 163,
"conntime" : 1398856332,
@mculp
mculp / haproxy.cfg
Last active Aug 29, 2015
haproxy setup
View haproxy.cfg
listen multi :6667
mode tcp
option tcplog
acl use_ruby payload(0,50) -i jimmyneutron
# acl use_ruby payload(0,50) -m sub jimmyneutron
# acl use_ruby payload(0,50) -m reg jimmyneutron
use-server ruby if use_ruby
server diamond 127.0.0.1:3420 check