Skip to content

Instantly share code, notes, and snippets.

View nunofernandes-plight's full-sized avatar

Nuno Edgar Nunes Fernandes nunofernandes-plight

View GitHub Profile
@stechu
stechu / periodic_payment.py
Last active February 26, 2020 13:14
Write a Periodic Payment Contract in PyTeal
#!/usr/bin/env python3
from pyteal import *
#template variables
tmpl_fee = Int(1000)
tmpl_period = Int(1000)
tmpl_dur = Int(1000)
tmpl_x = Bytes("base64", "y9OJ5MRLCHQj8GqbikAUKMBI7hom+SOj8dlopNdNHXI=")
tmpl_amt = Int(2000)
@NicolaBernini
NicolaBernini / pbt.ipynb
Created January 13, 2020 08:23
Property Based Testing in C++ with RapidCheck
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@markblundeberg
markblundeberg / atomic-size-attack.md
Created February 16, 2018 05:14
Advisory: secret size attack on cross-chain hash lock smart contracts

Advisory: secret size attack on cross-chain hash lock smart contracts

Dr. Mark B Lundeberg, 2018 Feb 15 bitcoincash:qqy9myvyt7qffgye5a2mn2vn8ry95qm6asy40ptgx2

This security advisory notes a vulnerability in the common construction of cross-chain smart contracts (contracts between distinct cryptocurrencies) through hash locking. I focus on the primary use case in [atomic

@addisonhuddy
addisonhuddy / svd.py
Created December 29, 2016 21:39
Singular Value Decomposition Example with Numpy
# Singular Value Decomposition Example
import numpy as np
# example taken from Video Tutorials - All in One
# https://www.youtube.com/watch?v=P5mlg91as1c
a = np.array([[1, 1, 1, 0, 0],
[3, 3, 3, 0, 0],
[4, 4, 4, 0, 0],
[5, 5, 5, 0, 0],
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@awjuliani
awjuliani / SimplePolicy.ipynb
Created September 11, 2016 00:20
Policy gradient method for solving n-armed bandit problems.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@awjuliani
awjuliani / Q-Table Learning-Clean.ipynb
Last active October 25, 2022 07:57
Q-Table learning in OpenAI grid world.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nunofernandes-plight
nunofernandes-plight / addressfixes.js
Created April 2, 2016 15:30 — forked from frozeman/addressfixes.js
Fixes the wallet links in the ethereum wallet
// Open the wallet console: Menu -> Develop -> Toggle console ...
// Run the following script
_.each(Wallets.find().fetch(), function(item){
if(item.address)
Wallets.update(item._id, {$set: {address: item.address.toLowerCase()}});
});
_.each(CustomContracts.find().fetch(), function(item){
if(item.address)
CustomContracts.update(item._id, {$set: {address: item.address.toLowerCase()}});
@frozeman
frozeman / addressfixes.js
Last active September 4, 2022 01:04
Fixes the wallet links in the ethereum wallet
// Open the wallet console: Menu -> Develop -> Toggle console ...
// Run the following script
_.each(Wallets.find().fetch(), function(item){
if(item.address)
Wallets.update(item._id, {$set: {address: item.address.toLowerCase()}});
});
_.each(CustomContracts.find().fetch(), function(item){
if(item.address)
CustomContracts.update(item._id, {$set: {address: item.address.toLowerCase()}});