Skip to content

Instantly share code, notes, and snippets.

View vicenteherrera's full-sized avatar
💭
hitting all the keys

Vicente Herrera vicenteherrera

💭
hitting all the keys
View GitHub Profile
@leon-domingo
leon-domingo / validar-cups.js
Last active March 12, 2024 12:46
Función para validar el CUPS (Código Unificado de Punto de Suministro)
/**
* Valida un CUPS (Código Unificado de Punto de Suministro) dado
* @param {string} CUPS Código CUPS que se quiere verificar. Más información aquí: https://es.wikipedia.org/wiki/C%C3%B3digo_Unificado_de_Punto_de_Suministro
* @returns Resultado de la verificación. `true` si el CUPS dado es correcto, o `false` en caso contrario.
*/
function validarCUPS(CUPS) {
let ret = false;
const reCUPS = /^[A-Z]{2}(\d{4}\d{12})([A-Z]{2})(\d[FPCRXYZ])?$/i;
if (reCUPS.test(CUPS)) {
const mCUPS = CUPS.toUpperCase().match(reCUPS);
@drzippie
drzippie / example.md
Created May 24, 2019 08:47
Basic NER Service using MITIE

curl -d @sample_request.txt -X POST https://ner.morcego.net/ner

response:

[{"tag": "ORGANIZATION", "score": 0.40190129560515164, "label": "Furnival Barristers"}, {"tag": "PERSON", "score": 1.0128972145423198, "label": "Edith Oliv\u00e9 Bocanegra"}, {"tag": "LOCATION", "score": 0.9171091771615874, "label": "Panam\u00e1"}, {"tag": "PERSON", "score": 0.3877786881212515, "label": "Mossack & Fonseca"}, {"tag": "LOCATION", "score": 1.0092007968591041, "label": "Espa\u00f1a"}]% ➜ ~

@caseywatts
caseywatts / 0 push to talk.md
Last active September 21, 2023 13:55
Push To Talk - Google Meet Bookmarklet

Short link to this page: http://caseywatts.com/ptt

Other gists & tricks: http://caseywatts.com/gists-and-tricks

Unrelated update: my book is out! Debugging Your Brain is an applied psychology / self-help book

Push To Talk in a Google Hangout (Meet)

  1. Save this bookmarklet. Right-click on boomarks toolbar Add Page...
  • Name: PTT (push to talk) or whatever you'd like (maybe short so it stays on your bookmarks toolbar)
@darrylkuhn
darrylkuhn / run-folder.sh
Created May 1, 2017 15:59
This small bash script allows newman users to run multiple newman commands and chain the results together. Requires newman 3.5.2 or later (I think)
#!/bin/sh
# Example run-folder.sh env.json collection.json "My Folder"
echo "Generating Temporary Environment"
newman run "${2}" --environment "${1}" --silent --export-env /tmp/temp-newman-env.json --folder "Fixtures"
newman run "${2}" --environment /tmp/temp-newman-env.json --bail --reporters cli --folder "${3}"
@MarcDiethelm
MarcDiethelm / Contributing.md
Last active June 12, 2024 19:37
How to contribute to a project on Github

This text now lives at https://github.com/MarcDiethelm/contributing/blob/master/README.md. I turned it into a Github repo so you can, you know, contribute to it by making pull requests.


Contributing

If you want to contribute to a project and make it better, your help is very welcome. Contributing is also a great way to learn more about social coding on Github, new technologies and and their ecosystems and how to make constructive, helpful bug reports, feature requests and the noblest of all contributions: a good, clean pull request.

@scy
scy / opening-and-closing-an-ssh-tunnel-in-a-shell-script-the-smart-way.md
Last active June 10, 2024 09:43
Opening and closing an SSH tunnel in a shell script the smart way

Opening and closing an SSH tunnel in a shell script the smart way

I recently had the following problem:

  • From an unattended shell script (called by Jenkins), run a command-line tool that accesses the MySQL database on another host.
  • That tool doesn't know that the database is on another host, plus the MySQL port on that host is firewalled and not accessible from other machines.

We didn't want to open the MySQL port to the network, but it's possible to SSH from the Jenkins machine to the MySQL machine. So, basically you would do something like

ssh -L 3306:localhost:3306 remotehost

@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007