Skip to content

Instantly share code, notes, and snippets.

View gabmontes's full-sized avatar

Gabriel Montes gabmontes

View GitHub Profile
@gabmontes
gabmontes / klotski.js
Created August 8, 2021 21:51
A small program to solve the Klotski puzzle, also know as "Trabado"
"use strict";
const initialState = [
"21v",
"4",
"4",
"22v",
"21v",
"4",
"4",
@gabmontes
gabmontes / new-mac-install.sh
Created April 21, 2021 13:28
Install many apps in a new Mac using a single script
#!/bin/sh
# Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
# Install all
brew cask install \
brave-browser \
docker \
gpg-suite-no-mail \
@gabmontes
gabmontes / last-eth-block-time.sh
Last active September 11, 2020 20:54
Get the time of the latest Ethereum block in one line
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["latest",false],"id":"0"}' -s http://localhost:8545| jq '.result.timestamp' | xargs -I {} node -e "console.log(new Date(Number.parseInt('{}'.substr(2),16) * 1000))"
@gabmontes
gabmontes / bloq.js
Created July 6, 2020 23:46
Sweep BCH paper wallets with easy
'use strict'
require('dotenv').config()
const { connect } = require('@bloq/cloud-sdk')
// Create a Bloq Connect client
const bloq = (coin = 'btc', network = 'mainnet') => connect.http({
coin,
network,
auth: {
  • 001 F-WTSS - Museum of Air and Space, Le Bourget, France
  • 002 G-BSST - Fleet Air Arm Museum, Yeovilton, England, UK
  • 101 G-AXDN - Imperial War Museum, Duxford, England, UK
  • 102 F-WTSA - Musée Delta, Orly Airport, Paris, France
  • 201 F-WTSB - Airbus Factory, Toulouse, France
  • 202 G-BBDG - Brooklands Museum, Weybridge, Surrey, England, UK
  • 203 F-BTSC - Destroyed in air crash outside Paris, France
  • 204 G-BOAC - Manchester Airport, England, UK
  • 205 F-BVFA - Smithsonian National Air and Space Museum, Chantilly, Virginia USA
  • 206 G-BOAA - Museum of Flight, East Lothian, Scotland, UK
  • Challenger OV-099
  • Enterprise OV-101 Intrepid Sea-Air-Space Museum, New York City, New York
  • Columbia OV-102
  • Discovery OV-103 Udvar-Hazy Center, Smithsonian Institution's National Air and Space Museum, Chantilly, Virginia
  • Atlantis OV-104 Kennedy Space Center, Merritt Island, Florida
  • Endeavour OV-105 California Science Center, Los Angeles, California.

Ref: https://en.wikipedia.org/wiki/Space_Shuttle_retirement

Alabama:

  • A-12 #06930 - On display at the U.S. Space & Rocket Center, Huntsville, AL.
  • A-12 #06937 - On display at the Southern Museum of Flight, Birmingham, AL.
  • A-12 #06938 - On display at the USS Alabama Battleship Memorial Park, Mobile, AL.

Arizona:

  • SR-71A #17951 - On display at the Pima Air Museum, Tucson, AZ.

California:

  • A-12 #06924 - On display at the Blackbird Airpark in Palmdale, CA.
@gabmontes
gabmontes / mnemonic-balance.js
Created February 17, 2019 23:03
Walk through all addresses derived from a mnemonic and sum up balances
const got = require('got')
const Mnemonic = require('bitcore-mnemonic')
const mnemonic = '? ? ? ? ? ? ? ? ? ? ? ?' // 12-word mnemonic
const words = Mnemonic.Words.ENGLISH // or SPANISH, etc
const derivationPath = "m/44'/0'/0'" // BIP-44
const insightApiUrl = 'https://insight.bitpay.com/api'
const toBtc = sat => sat / 100000000
@gabmontes
gabmontes / tu-144.md
Created December 22, 2018 18:58
List of Tu-144
Reg. no Model Type Engines Status
CCCP-68001 Tu-144 Prototype NK-144 Scrapped
CCCP-77101 Tu-144S Pre-production NK-144A Scrapped
CCCP-77102 Tu-144S Production NK-144A Crashed at 1973 Paris Air Show
CCCP-77103 Tu-144S Production NK-144A Scrapped
CCCP-77104 Tu-144S Production NK-144A Scrapped, remamed CCCP-77144
CCCP-77105 Tu-144S Production NK-144A Converted to Tu-144D, RD36-51, scrapped
CCCP-77106 Tu-144S Production NK-144A On display in Monino, Russia
CCCP-77107 Tu-144S Production NK-144A On display in Kazan, Russia
@gabmontes
gabmontes / crawl.js
Last active August 21, 2020 14:38
Analize a set of bitcoin addresses and find other related addresses
const got = require('got')
const {
concat,
difference,
flatten,
identity,
map,
memoize,
padEnd,
sortBy,