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
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`); |
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
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: |
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
# create Stargaze Austin POAP NFT | |
require 'json' | |
starting_number = 1 | |
# declare all attributes and variations | |
attributes = [ | |
"food_and_drink", | |
"landmark", | |
"activity", | |
] |
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
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 |
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
wf = words.reduce(Hash.new) { |h, w| h.update(w => h.fetch(w, 0) + 1) } |
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
"Spacey, Kevin".replace(/(.*?),\s+(.*)/i, "$2 $1"); | |
// #==> "Kevin Spacey" |
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
arr.sort{|x,y| x.to_i <=> y.to_i} |
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
" 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 |
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
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 |
NewerOlder