Skip to content

Instantly share code, notes, and snippets.

Max Riveiro kavu

Block or report user

Report or block kavu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View permission.sol
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 Aug 9, 2018
All Parity logging targets
View grep-it.sh
#!/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 Aug 19, 2016
Nice Go Makefile
View 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 Aug 29, 2015
Go Resources
View go.txt
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 Jun 20, 2017
Minimal Swift command line Hello World
View swift.sh
#!/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 Apr 12, 2014
Keybase Proof
View keybase.md

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 Apr 6, 2014
One day @gamesbrainiac asked me to make a simple File Watcher on Go…
View file_watcher.go
package main
import (
"log"
"os"
"path/filepath"
"time"
)
type pathsModTimes map[string]time.Time
View botclean.go
package main
import (
"fmt"
"strings"
)
type Position struct {
X, Y int
}
View Rakefile
task :console do
require 'irb'
require 'irb/completion'
require 'your_gem'
ARGV.clear
IRB.start
end
View utils.go
func IsInSlice(slice []int, searching int) bool {
intSlice := make(sort.IntSlice, len(slice))
copy(intSlice, slice)
sort.Sort(intSlice)
return sort.SearchInts(intSlice, searching) < len(slice)
}
You can’t perform that action at this time.