Skip to content

Instantly share code, notes, and snippets.

View dt665m's full-sized avatar

Denis Tsai dt665m

View GitHub Profile
@dt665m
dt665m / keybase.md
Created September 16, 2019 06:06
Keybase Proof

Keybase proof

I hereby claim:

  • I am dt665m on github.
  • I am dt665m (https://keybase.io/dt665m) on keybase.
  • I have a public key ASCVeI2UZs2xk2cAdWxm-u8-5dUZtnrdLVnBV9OMKIh-iAo

To claim this, I am signing this object:

@dt665m
dt665m / EventerSingle.sol
Created February 27, 2018 11:31
[BUG](go-ethereum) abigen gocode events with single parameter unmarshal error
pragma solidity ^0.4.18;
contract EventerSingle {
event SimpleEvent (address Addr);
function raiseSimpleEvent(address addr) {
SimpleEvent(addr);
}
}
function retry(options, callback) {
var req = https.request(options, function(res) {
var acc = "";
res.on("data", function(msg) {
acc += msg.toString("utf-8");
});
res.on("end", function() {
//if ok, callback(null, 'some data'), otherwise RECURSE retry(options,callback)
});
});
package main
import (
"fmt"
"time"
)
func doEvery(d time.Duration, f func(time.Time)) {
for x := range time.Tick(d) {
f(x)
@dt665m
dt665m / methodreceivers.go
Last active January 29, 2018 03:33
Method Receivers (Pointer vs Struct)
package main
import "fmt"
type Mutatable struct {
a int
b int
}
func (m Mutatable) StayTheSame() {
@dt665m
dt665m / functioncitizen.go
Last active January 29, 2018 03:33
Golang Lambdas and Thunks
package main
import (
"fmt"
)
func main() {
var MainInt int = 500
mainFunc := func(x int) bool {
@dt665m
dt665m / node_redux_example.js
Last active January 29, 2018 03:32
Redux Bare Minimum
var redux = require('redux')
var initialState = {
name: 'original',
count: 0
}
var IncrementAction = {
type: 'INCREMENT'
}