Skip to content

Instantly share code, notes, and snippets.

View alexanderattar's full-sized avatar
💭
⚡️

Alexander alexanderattar

💭
⚡️
View GitHub Profile
@alexanderattar
alexanderattar / wallet.js
Last active December 17, 2021 23:52 — forked from pedrouid/wallet.js
Example with ethers.js (Ethereum Wallet)
const ethers = require('ethers')
const standardPath = "m/44'/60'/0'/0";
const activeIndex = 0;
function generatePath(index) {
const path = `${standardPath}/${index}`;
return path;
}
@alexanderattar
alexanderattar / json-parsing.go
Created February 20, 2020 22:16 — forked from tomnomnom/json-parsing.go
Parsing arbitrary JSON with go
package main
import (
"log"
"fmt"
"encoding/json"
)
func main() {
b := []byte(`{"name": "tom", "favNum": 6, "interests": ["knives", "computers"], "usernames": {"github": "TomNomNom", "twitter": "@TomNomNom"}}`)
@alexanderattar
alexanderattar / redis_cheatsheet.bash
Created August 27, 2019 20:32 — forked from LeCoupa/redis_cheatsheet.bash
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
# 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
alexanderattar / signTypedData.js.md
Last active July 22, 2019 21:38 — forked from backus/signTypedData.js.md
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(
  "c87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3",
  "hex"
);
@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"
@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:

// 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() {
layout title description tags
default
SQL Style Guide
A guide to writing clean, clear, and consistent SQL.
data
process

Purpose

@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;
@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