Skip to content

Instantly share code, notes, and snippets.

View manishrjain's full-sized avatar

Manish R Jain manishrjain

View GitHub Profile

Let's test this thing:

python
from pyteal import *

def smart_contract():
    on_creation = Seq([
 App.globalPut(Bytes("required_arg"), Txn.application_args[0]),
@manishrjain
manishrjain / struct-icla.md
Last active June 6, 2023 16:16
ICLA for Struct Chat

Struct Chat, Inc.

Individual Contributor License Agreement ("Agreement")

Thank you for your interest in the "Project", owned and run by Struct Chat, Inc. ("Struct"). In order to clarify the intellectual property license granted with Contributions from any person or entity, Struct must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as

@manishrjain
manishrjain / chatgpt-badger-apikeys.go
Created December 10, 2022 19:19
ChatGPT writing Badger Code to store API keys
package main
import (
"fmt"
"math/rand"
"net/http"
"time"
"github.com/dgraph-io/badger"
"strings"
)
@manishrjain
manishrjain / parseTransaction.go
Created August 11, 2022 18:30 — forked from crazygit/parseTransaction.go
Parse Ethereum Transaction, Decode input data, Decode output data
package main
import (
"context"
"encoding/hex"
"fmt"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient"
@manishrjain
manishrjain / go.mod
Last active August 10, 2022 23:38
Parse Polygon Smart Contract using Go
module poly
go 1.18
require github.com/ethereum/go-ethereum v1.10.21
require (
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
github.com/deckarep/golang-set v1.8.0 // indirect
@manishrjain
manishrjain / ipc_test.go
Last active July 15, 2022 17:13
Compare Unix Domain Sockets against Named FIFO Pipes in Go
package main
import (
"crypto/rand"
"io"
"net"
"os"
"syscall"
"testing"
)
@manishrjain
manishrjain / main.go
Created May 1, 2018 13:13
Test Badger with Write-Delete Pairs
package main
import (
"fmt"
"log"
"net/http"
"strconv"
"sync"
"github.com/dgraph-io/badger"
@manishrjain
manishrjain / main.go
Created May 1, 2018 03:34
Test Badger with TTL
package main
import (
"encoding/binary"
"encoding/json"
"fmt"
"net/http"
_ "net/http/pprof"
"os"
"os/signal"
@manishrjain
manishrjain / super-tip.txt
Created December 8, 2016 05:58 — forked from ericdouglas/super-tip.txt
Change 4 spaces to 2 spaces indentation - Vim tip
%s;^\(\s\+\);\=repeat(' ', len(submatch(0))/2);g
@manishrjain
manishrjain / 81-thinkpad-dock.rules
Created October 31, 2016 13:07 — forked from seanf/81-thinkpad-dock.rules
Example ThinkPad docking script for multi-monitor
# Save this file (after modifying ID_VENDOR and ID_MODEL if necessary) as /etc/udev/rules.d/81-thinkpad-dock.rules
# These values seem to work for "ThinkPad Mini Dock Plus Series 3"
SUBSYSTEM=="usb", ACTION=="add|remove", ENV{ID_VENDOR}=="17ef", ENV{ID_MODEL}=="100a", RUN+="/etc/sbin/thinkpad-dock.sh"