Skip to content

Instantly share code, notes, and snippets.

@yubrew
yubrew / airdropChecker.js
Created January 2, 2024 23:36
dymension airdrop checker. first create wallets.txt with 1 address per line. then run this script
const fs = require("fs");
const readline = require("readline");
const axios = require("axios");
async function getAirdropStatus(address) {
const apiUrl = `https://geteligibleuserrequest-xqbg2swtrq-uc.a.run.app/?address=${address.toLowerCase()}`;
try {
const response = await axios.get(apiUrl);
const { amount } = response.data;
console.log(`${address} has a claim: ${amount} DYM`);
@yubrew
yubrew / cw-flattener.txt
Last active July 23, 2023 00:31
cw-flattener GPT conversation log
Rust CosmWasm Flattener
User
you are a code expert. The solidity-flattener repo contains a utility that can be used to combine Solidity projects into a single flat file. To use the utility, you first need to clone the repo and install the dependencies:
Code snippet
git clone https://github.com/poanetwork/solidity-flattener
cd solidity-flattener
npm install
Use code with caution. Learn more
Once the dependencies are installed, you can start the script by passing the path to the Solidity contract definition file as a parameter:
@yubrew
yubrew / gen.rb
Created June 13, 2022 20:18
Generate `nft_metadata_gen` metadata files. Creates weighted rarity metadata files ready for upload
# create Stargaze Austin POAP NFT
require 'json'
starting_number = 1
# declare all attributes and variations
attributes = [
"food_and_drink",
"landmark",
"activity",
]
@yubrew
yubrew / attempting to buy 1.0 btc
Created February 19, 2015 01:11
errors with cointrader
ct> buy 1.0 bitfinex:btc.usd
2015-02-18 20:09:39 [main] DEBUG o.cryptocoinpartners.module.Context - no module file found for OrderCommand.epl on classpath. Please ensure OrderCommand.epl is in the resources directory.
2015-02-18 20:09:39 [main] DEBUG o.cryptocoinpartners.module.Context - no module file found for AntlrCommandBase.epl on classpath. Please ensure AntlrCommandBase.epl is in the resources directory.
2015-02-18 20:09:39 [main] DEBUG o.cryptocoinpartners.module.Context - no module file found for CommandBase.epl on classpath. Please ensure CommandBase.epl is in the resources directory.
2015-02-18 20:09:39 [main] DEBUG org.cryptocoinpartners.persist - SpecificOrder: 53920de9-046c-4554-8289-e789072d8be7 saved to database
java.lang.NullPointerException
at org.cryptocoinpartners.schema.DiscreteAmount.times(DiscreteAmount.java:133)
at org.cryptocoinpartners.schema.Transaction.<init>(Transaction.java:103)
at org.cryptocoinpartners.module.BaseOrderService.CreateTransaction(BaseOrderService.java:534)
at
@yubrew
yubrew / gist:9770571
Created March 25, 2014 20:23
word array -> frequency hash
wf = words.reduce(Hash.new) { |h, w| h.update(w => h.fetch(w, 0) + 1) }
@yubrew
yubrew / switch last and first name with JS regex.js
Last active August 29, 2015 13:55
name switcharoo with regex.
"Spacey, Kevin".replace(/(.*?),\s+(.*)/i, "$2 $1");
// #==> "Kevin Spacey"
@yubrew
yubrew / gist:8336274
Created January 9, 2014 15:47
sort numerical array
arr.sort{|x,y| x.to_i <=> y.to_i}
@yubrew
yubrew / gist:6627430
Created September 19, 2013 18:02
strip whitespace. put in .vimrc
" Remove trailing whitespace upon save
function! <SID>StripTrailingWhitespaces()
" Preparation: save last search, and cursor position.
let _s=@/
let l = line(".")
let c = col(".")
" Do the business:
%s/\s\+$//e
" Clean up: restore previous search history, and cursor position
let @/=_s
@yubrew
yubrew / add_ctags.sh
Created July 24, 2013 14:32
ctags on os x
# use ctags on os x
# $ ctags -R
# ctags: illegal option -- R
# assuming you've installed the wonderful os x package manager homebrew
brew install ctags
# add ctags alias
alias ctags="`brew --prefix`/bin/ctags"
@yubrew
yubrew / gist:5869172
Created June 26, 2013 16:53
create and use gem locally
git clone git://github.com/luislavena/rb-readline.git
cd rb-readline
rake install #this creates the gem locally
gem uninstall rb-readline #make sure to comment out rb-readline in your Gemfile
gem install /path/to/rb-readline.gem