Skip to content

Instantly share code, notes, and snippets.

View alexanderattar's full-sized avatar
💭
⚡️

Alexander alexanderattar

💭
⚡️
View GitHub Profile
@alexanderattar
alexanderattar / .Title
Created August 17, 2017 03:40 — forked from congjf/.Title
Using MongoDB in golang with mgo
Using MongoDB in golang with mgo
@alexanderattar
alexanderattar / PostgreSQL_index_naming.rst
Created September 11, 2017 21:04 — forked from popravich/PostgreSQL_index_naming.rst
PostgreSQL index naming convention to remember

The standard names for indexes in PostgreSQL are:

{tablename}_{columnname(s)}_{suffix}

where the suffix is one of the following:

  • pkey for a Primary Key constraint;
  • key for a Unique constraint;
  • excl for an Exclusion constraint;
  • idx for any other kind of index;
layout title description tags
default
SQL Style Guide
A guide to writing clean, clear, and consistent SQL.
data
process

Purpose

0xd1901a035D234Ee458a3a85d9373C33D9728823a
// Report on "stuck" ether in empty contracts
// https://github.com/ethereum/EIPs/issues/156
// Usage: node find-stuck-ether.js [startBlock] [endBlock] > report.txt
let Eth = require('ethjs');
let eth = new Eth(new Eth.HttpProvider('http://localhost:8545'));
let ethutil = require('ethereumjs-util')
async function main() {

Keybase proof

I hereby claim:

  • I am alexanderattar on github.
  • I am spheres (https://keybase.io/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:

@alexanderattar
alexanderattar / update-golang.md
Last active February 16, 2018 21:34 — forked from nikhita/update-golang.md
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:

@alexanderattar
alexanderattar / verify_eth_sig.go
Last active February 16, 2018 22:20
Example of verifying a ethereum signature from a signed message in Go. Returns the signers address.
package main
import (
"fmt"
"github.com/ethereum/go-ethereum/crypto"
"github.com/go-ethereum/common/hexutil"
)
func main() {

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
alexanderattar / postgres_array.go
Created July 17, 2018 14:17 — forked from adharris/postgres_array.go
PostgreSQL demo of Array types using Golang
package main
import (
"database/sql"
"errors"
"fmt"
_ "github.com/bmizerany/pq"
"os"
"regexp"
"strings"