Skip to content

Instantly share code, notes, and snippets.

View leonprou's full-sized avatar
🎯
On target

Leon Prouger leonprou

🎯
On target
  • Tel Aviv
  • 05:24 (UTC +03:00)
View GitHub Profile
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
export GOOGLE_APPENGINE=/usr/local/google_appengine
export PYTHONPATH=$PYTHONPATH:/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PIL:/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
export ANDROID_HOME=/Library/Developer/android-sdk-macosx
export PGDATA=/var/lib/pgsql/data
# Setting PATH for Python 2.7
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
PATH=$ANDROID_HOME/tools:${PATH}
eval "$(pyenv init -)"
alias vim=nvim
#Postgres
export PGDATA=/var/lib/pgsql/data
#Flask app
export FLASK_APP=./autoapp.py
export FLASK_DEBUG=1
" Specify a directory for plugins
" - For Neovim: ~/.local/share/nvim/plugged
" - Avoid using standard Vim directory names like 'plugin'
set number
let g:typescript_indent_disable = 1
call plug#begin('~/.vim/plugged')
Plug 'scrooloose/nerdtree'
@leonprou
leonprou / decodeContractLogsToEvents.js
Last active September 22, 2019 11:23
decode logs of web3js contract to events
const isArray = require('lodash/isArray')
const logsToEvents = (logs, contract) => {
if (isArray(logs)) {
const events = {}
logs.forEach((log, index) => {
log = contract.events.allEventsLogDecoder.decode(contract.abiModel, log)
if (log.event) {
@leonprou
leonprou / pk_from_mnemonic.js
Last active July 30, 2020 14:17
Private key from mnemonic
require('ethereumjs-wallet/hdkey').fromMasterSeed(m).deriveChild(i).getWallet().getAddressString()
require('ethereumjs-wallet/hdkey').fromMasterSeed(m).deriveChild(i).getWallet().getPrivateKeyString()
for (let i = 0; i < 15; i++) {
console.log(`${i}: ${require('ethereumjs-wallet/hdkey').fromMasterSeed(m).deriveChild(i).getWallet().getAddressString()}`)
}
0xD418c5d0c4a3D87a6c555B7aA41f13EF87485Ec6
const { request } = require('graphql-request')
const axios = require('axios')
const getAccountCharacters = async accountName => {
var options = {
method: 'POST',
url: 'https://www.pathofexile.com/character-window/get-characters',
headers: {
authority: 'www.pathofexile.com',
accept: 'application/json, text/javascript, */*; q=0.01',
#docker stop $CONTAINER_NAME
# open the redis CLI
sudo docker-compose exec redis redis-cli
# check the current blocknumber of the $CONRAINER_ID:lastProcessedBlock
GET $CONRAINER_ID:lastProcessedBlock
# set to a new value. 5831273 is the current last relayed block on Mainnet.
SET $CONRAINER_ID:lastProcessedBlock 5831273
# close the redis CLI
@leonprou
leonprou / rewind fuseoracle-initiate-change
Created July 16, 2020 18:15
To sync the end of cycle on Fuse, you need to set the last processed block to the end of cycle that suceeded
# stop the container
docker stop fuseoracle-initiate-change
# open the redis CLI
sudo docker-compose exec redis redis-cli
# check that the redis key is correct (should be not nil)
GET native-erc-initiate-change:lastProcessedBlock
# set to a new value. 5831273 is currently the last relayed block on Mainnet.
SET native-erc-initiate-change:lastProcessedBlock 5831273
@leonprou
leonprou / rewind fuseoracle-initiate-change
Created July 16, 2020 18:15
To sync the end of cycle on Fuse, you need to set the last processed block to the end of cycle that suceeded
# stop the container
docker stop fuseoracle-initiate-change
# open the redis CLI
sudo docker-compose exec redis redis-cli
# check that the redis key is correct (should be not nil)
GET native-erc-initiate-change:lastProcessedBlock
# set to a new value. 5831273 is currently the last relayed block on Mainnet.
SET native-erc-initiate-change:lastProcessedBlock 5831273