Skip to content

Instantly share code, notes, and snippets.

View nopslip's full-sized avatar
👾

zKWolf nopslip

👾
View GitHub Profile

Keybase proof

I hereby claim:

  • I am nopslip on github.
  • I am zacharywolff (https://keybase.io/zacharywolff) on keybase.
  • I have a public key whose fingerprint is DA3D 9E22 F4CE EBF0 328D 8856 D373 1464 F71C C532

To claim this, I am signing this object:

sudo su postgres
psql -U postgres
postgres=> SELECT pg_reload_conf();
@nopslip
nopslip / vesting.sol
Last active November 12, 2020 21:15 — forked from rstormsf/vesting.sol
pragma solidity 0.4.24;
import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
contract VestingVault12 {
using SafeMath for uint256;
using SafeMath for uint16;
@nopslip
nopslip / PYTHON-OSX-DEV.md
Last active November 24, 2020 17:13
Quick notes on my favorite Python OSX dev env setup

Python development OSX setup/config notes

After working through a number of different local configs for Python development I've landed on this as my desired setup. My primary use cases are Django, stand alone scripts, and Heroku apps.

base setup (use homebrew for both)

https://github.com/pyenv/pyenv

use python pyenv-virtualenv

https://github.com/pyenv/pyenv-virtualenv

OXS Gitcoin Web Setup Guide For Beginners

Prerequisites

While you don't have to run Gitcoin Web from Docker it makes things much easier. For that reason, this guide will stick to a Docker based setup.

Install Docker - https://hub.docker.com/editions/community/docker-ce-desktop-mac/

Confirm docker & docker compose are running on the latest version

pragma solidity >=0.7.0 <0.9.0;
contract LeafHash {
// encoded user_id, amount
event Encoded(bytes encoded_data);
// echo leaf_hash_1
event LeafHash1(bytes32 leaf_hash_1);
# python 3.9.0
# web3py 5.19.0 - https://github.com/ethereum/web3.py
# This script is sample of how to get deterministic address of a contract based on nonce
# adapted/modified from https://ethereum.stackexchange.com/a/63235
import rlp
from web3 import Web3
base_address = "0x6ac7ea33f8831ea9dcc53393aaa88b25a785dbf0"
nonce = 1
@nopslip
nopslip / ChainLinkRandom.sol
Created September 3, 2021 02:50
Random sequence from one Chainlink VRF
// SPDX-License-Identifier: MIT
pragma solidity 0.6.6;
// forked from https://docs.chain.link/docs/get-a-random-number/
import "@chainlink/contracts/src/v0.6/VRFConsumerBase.sol";
/**
* THIS IS AN EXAMPLE CONTRACT WHICH USES HARDCODED VALUES FOR CLARITY.
* PLEASE DO NOT USE THIS CODE IN PRODUCTION.

Voltaire.edu

Spark level 001

Basic NFT mint. Create minimum viable NFT.

Mission

You wake up hazy and unsure where you are. There is a creek headed up from the road. You head up the creek into the jungle, hoping it's safer than whats below.

As you ascend the creek you notice gem glistening in the sand below the water.

# from https://milovantomasevic.com/blog/stackoverflow/2021-04-21-convert-csv-to-json-file-in-python/
import csv
import json
import time
def csv_to_json(csvFilePath, jsonFilePath):
jsonArray = []
#read csv file
with open(csvFilePath, encoding='utf-8') as csvf: