Skip to content

Instantly share code, notes, and snippets.


Alexander alexanderattar

View GitHub Profile
alexanderattar / json-parsing.go
Created Feb 20, 2020 — forked from tomnomnom/json-parsing.go
Parsing arbitrary JSON with go
View json-parsing.go
package main
import (
func main() {
b := []byte(`{"name": "tom", "favNum": 6, "interests": ["knives", "computers"], "usernames": {"github": "TomNomNom", "twitter": "@TomNomNom"}}`)
alexanderattar / redis_cheatsheet.bash
Created Aug 27, 2019 — forked from LeCoupa/redis_cheatsheet.bash
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION -->
View redis_cheatsheet.bash
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.
alexanderattar /
Last active Jul 22, 2019 — forked from backus/
How signTypedData works

I couldn't find a good explanation of each step of signTypedData EIP with examples of inputs and outputs at each step. I wanted this so I could keep track.

Say this is our private key

const privKey = new Buffer(
View deploy_solidity_contract.js
let fs = require("fs");
let Web3 = require('web3'); //
// Create a web3 connection to a running geth node over JSON-RPC running at
// http://localhost:8545
// For geth VPS server + SSH tunneling see
let web3 = new Web3();
web3.setProvider(new web3.providers.HttpProvider('http://localhost:8545'));
alexanderattar / postgres_array.go
Created Jul 17, 2018 — forked from adharris/postgres_array.go
PostgreSQL demo of Array types using Golang
View postgres_array.go
package main
import (
_ ""

Univerally recognised mathematical symbols and their name/meaning

≡ is defined as/is equivalent to

= is equal to

≠ is not equal to

‖...‖ size (length) of

alexanderattar / verify-eth-sig.js
Last active Sep 20, 2020
Example of how to sign a message with web3 and recover the address that signed it
View verify-eth-sig.js
var ethUtil = require('ethereumjs-util');
var data = 'Login';
var message = ethUtil.toBuffer(data);
var msgHash = ethUtil.hashPersonalMessage(message);
var privateKey = new Buffer('62debf78d596673bce224a85a90da5aecf6e781d9aadcaedd4f65586cfe670d2', "hex")
var sig = ethUtil.ecsign(msgHash, privateKey);
var signature = ethUtil.toBuffer(sig)
alexanderattar / verify_eth_sig.go
Last active Feb 16, 2018
Example of verifying a ethereum signature from a signed message in Go. Returns the signers address.
View verify_eth_sig.go
package main
import (
func main() {
alexanderattar /
Last active Feb 16, 2018 — forked from nikhita/
How to update the Go version

How to update the Go version

System: Mac OS Sierra (10.12.6)

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by:


Keybase proof

I hereby claim:

  • I am alexanderattar on github.
  • I am spheres ( on keybase.
  • I have a public key whose fingerprint is 4DA1 8F55 B579 3278 F11A 3674 7711 0903 C05C 6ECF

To claim this, I am signing this object:

You can’t perform that action at this time.