Skip to content

Instantly share code, notes, and snippets.

View TanjinAlam's full-sized avatar

Tanjin Alam TanjinAlam

View GitHub Profile
#!python3
import hashlib
import math
import sys
from base64 import b64decode, b64encode
prooffile = "proof.txt" # File where Merkle proof will be written.
MAXHEIGHT = 20 # Max height of Merkle tree
@TanjinAlam
TanjinAlam / bitcoin-merkle-proofs.js
Created December 24, 2022 09:00 — forked from eddmann/bitcoin-merkle-proofs.js
Bitcoin Internals: Verifying Merkle Roots using Merkle Proofs in JavaScript
const fetchLatestBlock = () =>
fetch(`https://blockchain.info/q/latesthash?cors=true`)
.then(r => r.text());
const fetchMerkleRootAndTransactions = block =>
fetch(`https://blockchain.info/rawblock/${block}?cors=true`)
.then(r => r.json())
.then(d => [d.mrkl_root, d.tx.map(t => t.hash)]);
const random = arr =>
mkdir node1 node2
geth account new --datadir ./node1
geth account new --datadir ./node2
puppeth
export mytestnet.json
geth init --datadir "./node1" mytestnet.json
# Copyright 2018-2020 Cargill Incorporated
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
from pyteal import *
from pyteal.ast.bytes import Bytes
from pyteal_helpers import program
def approval():
# local variable for each users
# global_owner = Bytes("owner") # byteslice
# local_owner = Bytes("owner") # byteslice
# local_balance = Bytes("balance") # uint64
// const algosdk = require('algosdk')
// const dotenv = require("dotenv");
// const fs = require("fs");
const algosdk = require("algosdk");
// dotenv.config();
//SMART CONTRACT DEPLOYMENT
// declare application state storage (immutable)
const localInts = 0;
@TanjinAlam
TanjinAlam / Steezy Token
Created August 21, 2022 10:42
Steezy Token
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract Steezy is ERC20 {
using SafeMath for uint256;
address public owner;
mapping(address => bool) public whitelistedAddresses;
@TanjinAlam
TanjinAlam / install-ubuntu-docker-practice.sh
Last active June 21, 2022 08:02
hummingbot setup bash script
# 1) Update Ubuntu's database of software
sudo apt-get update
# 2) Install tmux
sudo apt-get install -y tmux
# 3) Install Docker
sudo apt install -y docker.io
# 4) Start and Automate Docker
sudo systemctl start docker && sudo systemctl enable docker
# 5) Change permissions for docker (optional)
# Allow docker commands without requiring sudo prefix
// Interface Class
package javaapplication1;
import java.util.ArrayList;
public interface In1 {
final static ArrayList<Integer> arrli = new ArrayList<Integer>();
}
//first class
#include<windows.h>
#include <GL/glut.h>
#include<math.h>
void init2D(float r, float g, float b)
{
glClearColor(r,g,b,0.0);
glMatrixMode (GL_PROJECTION);
gluOrtho2D (-500, 500.0, -500, 500.0);
}