Skip to content

Instantly share code, notes, and snippets.

View alexanderattar's full-sized avatar
💭
⚡️

Alexander alexanderattar

💭
⚡️
View GitHub Profile
@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 / 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 / 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 / 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 / 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;
}