Skip to content

Instantly share code, notes, and snippets.

⌨️
keyboard shredding

Miguel Mota miguelmota

⌨️
keyboard shredding
Block or report user

Report or block miguelmota

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@miguelmota
miguelmota / erc20.go
Last active Jul 16, 2019
Go go-ethereum watch ERC-20 token transfer events
View erc20.go
// Code generated - DO NOT EDIT.
// This file is a generated binding and any manual changes will be lost.
package token
import (
"math/big"
"strings"
ethereum "github.com/ethereum/go-ethereum"
@miguelmota
miguelmota / ssm_parameter.go
Last active Jul 16, 2019
AWS SSM Go SDK parameter store example
View ssm_parameter.go
package main
import (
"fmt"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/ssm"
)
@miguelmota
miguelmota / minus-percent.js
Created Nov 19, 2014
Minus percent function in JavaScript
View minus-percent.js
function minusPercent(n,p) {
return n - (n * (p/100));
}
console.log(minusPercent(100,30)); // 70
@miguelmota
miguelmota / bcrypt_salt.js
Last active Jul 16, 2019
JavaScript extract salt from bcrypt hash
View bcrypt_salt.js
// the salt is the first 22 characters after the third '$'
// https://en.wikipedia.org/wiki/Bcrypt
const hash = '$2a$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy'
const salt = hash.split('$')[3].substr(0, 22)
console.log(salt) // N9qo8uLOickgx2ZMRZoMye
@miguelmota
miguelmota / keccak_cli.sh
Created Jul 15, 2019
keccak256 cli (macOS)
View keccak_cli.sh
brew install sha3sum
echo -n hello | keccak-256sum
1C8AFF950685C2ED4BC3174F3472287B56D9517B9C948127319A09A7A36DEAC8 -
@miguelmota
miguelmota / transaction_hash.sh
Created Jul 15, 2019
Web3.js get transaction hash from signed transaction data
View transaction_hash.sh
const txHash = web3.utils.sha3('<signed-transaction-data>', {encoding: 'hex'})
@miguelmota
miguelmota / remove_tuxera.sh
Last active Jul 14, 2019
Completely uninstall and remove Tuxera NTFS on MacOS (resets trial version)
View remove_tuxera.sh
sudo rm -rf /Applications/Tuxera\ Disk\ Manager.app
sudo rm -rf /Library/Application\ Support/Tuxera\ NTFS
sudo rm -rf /Library/Filesystems/fusefs_txantfs.fs
@miguelmota
miguelmota / nodejs-directory-structure.md
Last active Jul 14, 2019
Node.js MVC directory structure example.
View nodejs-directory-structure.md
Node.js MVC directory structure example.
├── app
│   ├── controllers
│   │   ├── admin
│   │   │   ├── posts.js
│   │   │   └── users.js
│   │   ├── posts.js
│   │   ├── session.js
@miguelmota
miguelmota / install_deps.sh
Created Jul 14, 2019
TypeScript tslint standard
View install_deps.sh
npm i -D tslint tslint-config-standard
@miguelmota
miguelmota / index.test.ts
Last active Jul 13, 2019
TypeScript tests using jest
View index.test.ts
import * as lib from './'
test('test', async () => {
expect(await lib.hello()).toBe('world')
})
You can’t perform that action at this time.