Skip to content

Instantly share code, notes, and snippets.

View gabmontes's full-sized avatar

Gabriel Montes gabmontes

View GitHub Profile
@gabmontes
gabmontes / gmailCleanup.js
Last active March 1, 2024 18:11
Google Apps script to cleanup messages from GMail.
// Inspired in http://www.johneday.com/422/time-based-gmail-filters-with-google-apps-script
// Deletes old marked conversations
function cleanUp() {
var delayDays = 5; // # of days before messages are moved to trash
var label = "Delete me"; // label to identify the messages
var maxDate = new Date(Date.now() - delayDays * 24 * 60 * 60 * 1000);
var userLabel = GmailApp.getUserLabelByName(label);
if (!userLabel) {
return;
  • 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

  • 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
@gabmontes
gabmontes / delete-all-my-gists.js
Last active December 3, 2023 08:39
Delete all your gists
var async = require('async');
var GitHubApi = require('github');
var github = new GitHubApi({
version: '3.0.0',
protocol: 'https'
});
github.authenticate({
type: 'basic',
@gabmontes
gabmontes / ExpressABM.md
Last active February 7, 2023 15:23
Creación de un ABM (CRUD) básico con Express

ABM con Express

Objetivos

  • Crear servicios web para dar soporte a una aplicación de ABM

Estructura

Una aplicación web que permita administrar un tipo de recurso, como por ejemplo una lista de libros, tendrá los siguientes componentes:

@gabmontes
gabmontes / cbuvalidator.js
Last active October 27, 2022 15:01
Validator for "Clave Bancaria Uniforme", or CBU, as used in the Argentinean banking system
/**
* Validator and brute-force checksum generator for "Clave Bancaria Uniforme"
* fromat used in the Argentinan banking system.
*
* Legal stuff at http://www.infoleg.gob.ar/infolegInternet/anexos/45000-49999/47564/norma.htm
* Code based on https://gist.github.com/delucas/4526176
* Universal loader based on https://gist.github.com/jrburke/1262861
*/
/* global define, window */
@gabmontes
gabmontes / prune-branches.sh
Last active September 1, 2022 17:24
Prune repo and remove local branches deleted in origin
#!/bin/bash
if [ ! -d .git ]; then
echo Not a git repo
exit
fi
if ! (git remote | grep -q origin); then
echo No origin remote
exit
@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 / 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 / erc20EventsListener.js
Last active July 18, 2021 09:10
Very simple example of an ERC20 token events listener
const Web3 = require('web3')
const erc20Abi = abi = require('human-standard-token-abi')
const config = {
node: 'localhost:8546',
address: '0x0000000000000000000000000000000000000000' // set to contract address
}
const provider = new Web3.providers.WebsocketProvider(`ws://${config.node}`)
const web3 = new Web3(provider)