Skip to content

Instantly share code, notes, and snippets.

@maraoz
maraoz / gist:388eddec39d60c6d52d4
Created February 20, 2016 22:03
Imagenet output tensor index to label mapping
{
0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, crampfish, numbfish, torpedo',
6: 'stingray',
7: 'cock',
8: 'hen',
@maraoz
maraoz / deploy.ts
Created July 11, 2022 20:14
Using WalletConnect from a hardhat script example
import { ethers } from "hardhat";
import { Signer } from "ethers";
import WalletConnectProvider from "@walletconnect/web3-provider";
async function deploy(deployer: Signer) {
const address = await deployer.getAddress();
console.log("Deploying contracts with the account:", address);
console.log("Account balance:", (await deployer.getBalance()).toString());
@maraoz
maraoz / gist:7dbbd94070c689286da3
Created June 16, 2014 15:16
brain wallets in bitcore
var bitcore = require('bitcore');
var password = 'an example of an insecure password';
var privateKey = bitcore.util.sha256(password);
var key = new bitcore.Key();
key.private = privateKey;
key.regenerateSync();
var addr = new bitcore.Address.fromKey(key);
@maraoz
maraoz / links.txt
Last active June 20, 2018 12:57
some smart contracts links
0xb0145Ae156D201d6E371d07265FE3C045071c967
@maraoz
maraoz / Original version
Last active October 5, 2016 13:25
Hashed Timelock Contract (HTLC) as proposed in lightning.network paper
OP_DEPTH 3 OP_EQUAL
OP_IF
OP_HASH160 <hash160(R)> OP_EQUALVERIFY
OP_0 2 <AlicePubkey1> <BobPubkey1> 2 OP_CHECKMULTISIG
OP_ELSE
OP_0 2 <AlicePubkey2> <BobPubkey2> 2 OP_CHECKMULTISIG
OP_END
// Proof of Existence contract, version 1
contract ProofOfExistence {
// state
bytes32 proof;
// constructor
function ProofOfExistence() {
}
geth --testnet --rpc console 2>> geth.log
# First, let's install truffle
$ sudo npm install -g truffle
# let's setup our project
$ mkdir solidity-experiments
$ cd solidity-experiments/
$ truffle init
$ ls
app contracts migrations test truffle.js
> eth.getBalance(eth.accounts[0])
0