Skip to content

Instantly share code, notes, and snippets.

View guumaster's full-sized avatar
:octocat:
⌨️

Gustavo Marin guumaster

:octocat:
⌨️
View GitHub Profile

Split an image into a grid

Simple script to split an image into smaller grid of equal sizes, eg: 2x2, 2x3, 4x4, etc.

Requirements

It uses OpenCV to read/write the images. so you need to first install it with:

pip install opencv-python

NetCon 2022

Un pequeño proyecto de scrapping para recoger los datos de todas las partidas de las NetCon 2022.

Dev

Para ejecutar el scrapper solo necesitas Cypress.

@guumaster
guumaster / 00_README.md
Last active July 19, 2020 15:36
Golang CLI oauth2

Using Google oAuth2 on a CLI

This simple gist shows how to get an oAuth2 token and auto-refresh when needed.

Files

  • main.go - main file where you need to set your credentials and needed scopes.
  • token.go - token manager hides all the complexity of read/save/update the token.
  • google_apis.go - contains some example functions to access Google APIs like Drive, People and Spreadsheets.
@guumaster
guumaster / print_json.go
Created January 19, 2020 10:26
golang printJSON debug
// printJSON prints v as JSON encoded with indent to stdout. It panics on any error.
func printJSON(v interface{}) {
w := json.NewEncoder(os.Stdout)
w.SetIndent("", "\t")
err := w.Encode(v)
if err != nil {
panic(err)
}
}
@guumaster
guumaster / HOWTO.md
Created February 23, 2019 19:00
Multiple SSH Keys for Github

How to manage two Github users

If you want to have repos from two different Github users on the same machine, follow this steps:

@guumaster
guumaster / Introduccion a RxJS.md
Last active May 26, 2018 18:16
Introduccion a RxJS

Introducción a Reactive Programming con RxJS

En este articulo vamos a revisar algunos conceptos básicos de programación reactiva y como podemos sacar provecho de ellos en nuestros programas. Pero antes de empezar, preguntaros lo siguiente:

-- ¿Que diferencia hay entre una consulta a base de datos y una serie de clicks de ratón?

-- Ninguna, ambas son colecciones de datos

¿Qué es Reactive Programming?

@guumaster
guumaster / README.md
Created November 5, 2015 14:12
clase03.md

Exercise 1

create a server to:

  • output the diagonal sum o a given array by POST
  • use a middleware to validate a square matrix input

Exercise 1

create modules to implement this features

  • convert string to title capitalized
  • sanitize a string
  • count word frequency
'use strict';
let convert = require('./convert');
let freq = require('./frequency');
let input = process.argv[2] || 'EMPTY';
console.log( freq(convert(input)));
'use strict';
let convert = (str) => {
return str
.trim()
.split(/ +/)
.reduce((acc, word) => {
return (acc + ' ' + word[0].toUpperCase() + word.slice(1).toLowerCase()).trim();
}, '');
}