Skip to content

Instantly share code, notes, and snippets.

View zeddee's full-sized avatar

Zed zeddee

View GitHub Profile
@zeddee
zeddee / data.json
Created November 6, 2018 15:53
manipulating json with python
{
"article": [
{
"id":"01",
"language": "JSON",
"edition": "first",
"author": "Derrick Mwiti"
},
@zeddee
zeddee / a_sockets.go
Created November 20, 2018 16:45
simple websockets with go
package main
import (
"encoding/json"
"log"
"net/http"
"time"
"github.com/gorilla/websocket"
)
package main
import (
"fmt"
"github.com/boltdb/bolt"
log "github.com/sirupsen/logrus"
)
func main() {
package main
import (
"math/big"
"testing"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind/backends"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
package main
import (
"context"
"encoding/json"
"fmt"
"log"
"net/http"
"net/url"
"time"
package main
import (
"log"
"reflect"
)
type dummy interface{}
func main() {
pragma solidity >=0.4.15;
// Proof of Existence contract, version 3
// https://blog.zeppelin.solutions/the-hitchhikers-guide-to-smart-contracts-in-ethereum-848f08001f05
contract ProofOfExistence3 {
mapping (bytes32 => bool) private _proofs;
// store a proof of existence in the contract state
function _storeProof(bytes32 _proof) private {
_proofs[_proof] = true;
}
// calculate and store the proof for a document
package main
import (
"io/ioutil"
"log"
"os"
"path"
"regexp"
"strings"
)
@zeddee
zeddee / ethutils.go
Last active January 6, 2019 21:53
DO NOT USE. Attempt to convert Eth to Wei. Not 100% accurate.
// Attempt to convert Eth to Wei
package utils
import (
"log"
"math"
"math/big"
)
// EthToWei converts eth to wei
@zeddee
zeddee / reading-list-jan2019.adoc
Last active January 21, 2019 09:16
Reading List for Jan 2019

Reading List for Jan 2019

Moved here.