Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 hre = require("hardhat"); | |
async function main() { | |
const signers = await hre.ethers.getSigners(); | |
const owner = signers[0]; | |
const Airnode = await hre.ethers.getContractFactory("Airnode", owner); | |
const Convenience = await hre.ethers.getContractFactory("Convenience", owner); |
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 Web3 = require('web3') | |
const BN = require('bn.js') | |
const Big = require('big.js') | |
// what is a wad https://makerdao.com/purple/#sec-3-1 | |
const wadToEth = (value) => { | |
return (new Big(value)).div((new BN(10)).pow(new BN(18))) | |
} | |
const printEvent = (web3, eventType) => (event) => { |
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 | |
sudo pkill TouchBarServer; sudo killall ControlStrip |
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 | |
# need curl and jq installed | |
# go to https://api.slack.com/apps and create an app | |
# add OAuth permissions: | |
# calls:write | |
# channels:join | |
# channels:manage | |
# channels:read |
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
import json | |
from datetime import datetime | |
import reverse_geocoder as rg | |
location_history = None | |
json_filename = 'timeline_history/Location History/Location History.json' | |
print('Loading: %s' % json_filename) | |
with open(json_filename, 'r') as f: | |
location_history = json.load(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
#!/bin/bash | |
#Libs used for keccak-256sum | |
#https://github.com/maandree/libkeccak.git | |
#https://github.com/maandree/argparser.git | |
#https://github.com/maandree/sha3sum.git | |
# Generate the private and public keys | |
KEY="$(openssl ecparam -name secp256k1 -genkey -noout | openssl ec -text -noout 2> /dev/null)" | |
echo "$KEY" |
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
def mining(k, mines): | |
n = len(mines) | |
#create matrix | |
matrix = [] | |
for i in range(n): | |
row = [] | |
distance_i = mines[i][0] | |
weight_i = mines[i][1] | |
for j in range(n): | |
distance_j = mines[j][0] |
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 | |
#-x | |
NODE_NUMBER=$1 | |
REMAINING_ARGS=${@:2} | |
re_number=^-?[0-9]+$ | |
if ! [[ $NODE_NUMBER =~ $re_number ]]; then | |
echo "First argument needs to be a number!" | |
exit 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
const level = require('level') | |
const rlp = require('rlp') | |
const chaindatadirectory = './data_node_0/geth/chaindata' | |
const TX_ROOT_HASH = '146d436eb3af4eeaf1f421d86a8994ef9f6e3670393837e9141f7f44b00e01cf' | |
const STATE_ROOT_HASH = '0c773fdbbe314cbeb0908d1b4949b39d1edca0653efee339882679538fce3318' | |
level(chaindatadirectory, { keyEncoding: 'utf8', valueEncoding: 'binary'}, async (err, db) => { | |
if(err) { | |
console.log('ERROR: ',err) |
NewerOlder