Skip to content

Instantly share code, notes, and snippets.

View derekchiang's full-sized avatar

Derek Chiang derekchiang

View GitHub Profile
# this example shows how to debug output from Viem
# make sure you have installed kek: https://github.com/zerodevapp/kek
# and make sure you have installed Foundry: https://book.getfoundry.sh/
# then run this command:
kek debug " callData: 0xe9ae5c53000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000034F892531A10B0060d3F0eCeeA2Da5dFbE7c41fE9c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
callGasLimit: 11192
factory: 0xd703aaE79538628d27099B8c4f621bE4CCd142d5
factoryData: 0xc5265d5d000000000000000000000000aac5d4240af87249b3f71bc8e4a2cae074a3e4190000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001243c3
# make sure you have installed kek: https://github.com/zerodevapp/kek
# and make sure you have installed Foundry: https://book.getfoundry.sh/
# then run this command:
kek debug '{
"sender": "0x3976E2bA1a6343cCb3e6Fe25c72760302861D88f",
"nonce": "913479994650515257524606220465835134743662536739504695803980018773655552",
"initCode": "0xd703aaE79538628d27099B8c4f621bE4CCd142d5c5265d5d000000000000000000000000aac5d4240af87249b3f71bc8e4a2cae074a3e4190000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001243c3b752b01845ADb2C711129d4f3966735eD98a9F09fC4cE570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000
@derekchiang
derekchiang / passkey-cab.ts
Created October 10, 2024 11:36
CAB example using passkeys
import { createKernelCABClient } from "@zerodev/cab"
import {
WebAuthnMode,
createKernelMultiChainClient,
deserializeMultiChainWebAuthnValidator,
toMultiChainWebAuthnValidator,
toWebAuthnKey
} from "@zerodev/multi-chain-validator"
import { createKernelAccount } from "@zerodev/sdk"
import { http, createPublicClient } from "viem"
let HDWalletProvider = require('truffle-hdwallet-provider')
let { mnemonic, infuraKey } = require('./credentials.json')
module.exports = {
// See <http://truffleframework.com/docs/advanced/configuration>
// to customize your Truffle configuration!
//
networks: {
development: {
host: "localhost",
@derekchiang
derekchiang / app.html
Last active August 13, 2024 08:01 — forked from bellbind/app.html
[electron]Use electron as a Web Server
<!doctype html>
<html><head><script src="app.js"></script></head><body></body></html>
package main
import "fmt"
// WithPrefix
type prefixOption struct{}
func WithPrefix() interface {
GetOption
#!/usr/bin/env bash
apt-get -y install postgresql-9.4 postgresql-contrib-9.4 postgresql-server-dev-9.4
###########################################
# Hack alert:
# For Postgresql 9.4, pg_rewind is not in the main source tree and
# no packages exist in the repos, so it must be compiled manually
# and installed on the image until we can move to 9.5
# See README at
goroutine profile: total 557
75 @ 0x42c78a 0x43b964 0x43a5cc 0x7dbe7f 0x458e71
# 0x7dbe7e github.com/pachyderm/pachyderm/src/server/vendor/google.golang.org/grpc.newClientStream.func3+0x40e /go/src/github.com/pachyderm/pachyderm/src/server/vendor/google.golang.org/grpc/stream.go:236
62 @ 0x42c78a 0x43b964 0x43a5cc 0x162cf26 0x458e71
# 0x162cf25 github.com/pachyderm/pachyderm/src/server/vendor/github.com/coreos/etcd/clientv3.(*watchGrpcStream).serveSubstream+0x525 /go/src/github.com/pachyderm/pachyderm/src/server/vendor/github.com/coreos/etcd/clientv3/watch.go:591
53 @ 0x42c78a 0x43b964 0x43a5cc 0x162c377 0x458e71
# 0x162c376 github.com/pachyderm/pachyderm/src/server/vendor/github.com/coreos/etcd/clientv3.(*watchGrpcStream).run+0x15b6 /go/src/github.com/pachyderm/pachyderm/src/server/vendor/github.com/coreos/etcd/clientv3/watch.go:421
heap profile: 6: 21725184 [83739: 44860896] @ heap/1048576
2: 20971520 [2: 20971520] @ 0x87f70f 0x1660812 0x866d83 0x7d3649 0x7d4c3d 0x7da5f9 0x458e71
# 0x87f70e github.com/pachyderm/pachyderm/src/server/vendor/github.com/pachyderm/pachyderm/src/client/pkg/grpcutil.WriteToStreamingBytesServer+0x8e /go/src/github.com/pachyderm/pachyderm/src/server/vendor/github.com/pachyderm/pachyderm/src/client/pkg/grpcutil/stream.go:72
# 0x1660811 github.com/pachyderm/pachyderm/src/server/pfs/server.(*localBlockAPIServer).GetObject+0x181 /go/src/github.com/pachyderm/pachyderm/src/server/pfs/server/local_block_api_server.go:99
# 0x866d82 github.com/pachyderm/pachyderm/src/server/vendor/github.com/pachyderm/pachyderm/src/client/pfs._ObjectAPI_GetObject_Handler+0x112 /go/src/github.com/pachyderm/pachyderm/src/server/vendor/github.com/pachyderm/pachyderm/src/client/pfs/pfs.pb.go:2458
# 0x7d3648 github.com/pachyderm/pachyderm/src/server/vendor/google.golang.org/grpc.(*Server).processStreamingRPC+0x7b8 /go/src/github.co
@derekchiang
derekchiang / mesos-simulator-usage.md
Last active August 29, 2015 14:24
Mesos Simulator Usage

Usage

  1. Compile this Mesos fork like you normally would.

Notice that we are currently on the custom-exec branch.

  1. Set the environment variable MESOS_DEFAULT_EXECUTOR_PATH to $BUILD_DIR/src/mesos-simexecutor

BUILD_DIR is your build directory.