Skip to content

Instantly share code, notes, and snippets.

View daragao's full-sized avatar

Duarte Aragão daragao

View GitHub Profile
@daragao
daragao / parse_timeline_history.py
Created November 11, 2019 00:13
Parses history location from https://takeout.google.com/ (useful to check where you have been in the last few years)
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)
@daragao
daragao / slackspammer.sh
Last active January 29, 2020 13:49
Slack Spammer
#!/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
@daragao
daragao / refreshTouchbar.sh
Created January 15, 2021 12:53
Everytime the Esc disappears from the touchbar :)
#!/bin/bash
sudo pkill TouchBarServer; sudo killall ControlStrip
@daragao
daragao / printEvent.js
Created March 2, 2021 23:40
Simple Web3 script to print events
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) => {
@daragao
daragao / singleFileAPI3.js
Created March 3, 2021 17:08
API3 Airnode contracts make a request and fulfill it
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);
@daragao
daragao / Chainlink Price feeds.ipynb
Last active August 1, 2021 15:41
Study about Chainlink in and outflows