Skip to content

Instantly share code, notes, and snippets.

@kavu
kavu / wishlist.txt
Last active July 1, 2020 07:41
My DIM Wishlist
dimwishlist:item=614426548&perks=2827049491,269888150,2030760728,3913600130
dimwishlist:item=614426548&perks=2827049491,269888150,1749209109,3913600130
dimwishlist:item=614426548&perks=3666208348,269888150,1749209109,3913600130
dimwishlist:item=614426548&perks=938542991,269888150,1749209109,3913600130
dimwishlist:item=614426548&perks=2827049491,269888150,2590710093,3913600130
dimwishlist:item=614426548&perks=3666208348,269888150,2590710093,3913600130
dimwishlist:item=614426548&perks=938542991,269888150,2590710093,3913600130
pragma solidity 0.5.5;
contract TxPermission {
/// Allowed transaction types mask
uint32 constant None = 0;
uint32 constant All = 0xffffffff;
uint32 constant Basic = 0x01;
uint32 constant Call = 0x02;
uint32 constant Create = 0x04;
uint32 constant Private = 0x08;
@kavu
kavu / grep-it.sh
Last active August 9, 2018 14:52
All Parity logging targets
#!/bin/sh
grep -Roh --exclude-dir=target 'target: "[^"]*",' parity | sed -n 's/target: \("[^"]*"\),/\1/p' | sed -n 's/"//pg' | sort | uniq
@kavu
kavu / Makefile
Created August 19, 2016 19:24
Nice Go Makefile
VERSION := $(shell git describe --tags | sed -e 's/^v//g' | awk -F "-" '{print $$1}')
ITERATION := $(shell git describe --tags --long | awk -F "-" '{print $$2}')
GO_VERSION=$(shell gobuild -v)
GO := $(or $(GOROOT),/usr/lib/go)/bin/go
PROCS := $(shell nproc)
cores:
@echo "cores: $(PROCS)"
test:
go test -v
bench:
@kavu
kavu / go.txt
Last active August 29, 2015 14:15
Go Resources
https://golang.org/doc/articles/wiki/
http://learnxinyminutes.com/docs/go/
http://codegangsta.gitbooks.io/building-web-apps-with-go/content/
http://dave.cheney.net/resources-for-new-go-programmers
http://www.golang-book.com/
http://golang.org/doc/effective_go.html
http://tour.golang.org/#1
http://golang.org/ref/spec
http://www.miek.nl/projects/learninggo/
https://gobyexample.com/
@kavu
kavu / swift.sh
Last active June 20, 2017 02:58
Minimal Swift command line Hello World
#!/bin/sh
# So you've installed XCode 6 Beta
# Now we could use Swift toolchain to build a minimal
# command line Hellow World
# let's set new Developer Toolchain bundled with Xcode6-Beta.app
# as default toolchain
# sudo xcode-select -s /Applications/Xcode6-Beta.app/Contents/Developer
# alias for Swift binary
@kavu
kavu / keybase.md
Created April 12, 2014 19:18
Keybase Proof

Keybase proof

I hereby claim:

  • I am kavu on github.
  • I am kavu (https://keybase.io/kavu) on keybase.
  • I have a public key whose fingerprint is F7F6 71A8 090C 7938 AB8E 84E2 8331 E923 9463 166D

To claim this, I am signing this object:

@kavu
kavu / file_watcher.go
Created April 6, 2014 19:02
One day @gamesbrainiac asked me to make a simple File Watcher on Go…
package main
import (
"log"
"os"
"path/filepath"
"time"
)
type pathsModTimes map[string]time.Time
package main
import (
"fmt"
"strings"
)
type Position struct {
X, Y int
}
task :console do
require 'irb'
require 'irb/completion'
require 'your_gem'
ARGV.clear
IRB.start
end