Skip to content

Instantly share code, notes, and snippets.

@NickCis
NickCis / Makefile
Created November 24, 2023 14:56
Extraer link de iframe de https://www.mega.cl/senal-en-vivo/
SHELL := /usr/bin/bash
.PHONY: activate clean format run help
help: # Show help for each of the Makefile recipes.
@grep -E '^[a-zA-Z0-9 -]+:.*#' Makefile | sort | while read -r l; do printf "\033[1;32m$$(echo $$l | cut -f 1 -d':')\033[00m:$$(echo $$l | cut -f 2- -d'#')\n"; done
venv: requirements.txt # Crea carpeta venv
python3 -m venv venv
source ./venv/bin/activate && \
@NickCis
NickCis / spec.json
Created January 18, 2023 21:12 — forked from stewartmcgown/spec.json
Google Web SMS Private API
This file has been truncated, but you can view the full file.
{
"version_module": true,
"title": "Instant Messaging Private API",
"ownerName": "Google",
"basePath": "",
"version": "v1",
"resources": {
"group": {
"methods": {
"kickgroupusers": {
#! /usr/bin/bash
## This script replaces time entries in am/pm format to 24hs
## $ echo "The event starts at 03:25pm and 11:11AM" | ./ampm-to-24
## The event starts at 15:25 and 11:11
# Match time entries: 03:25pm 11:11AM
regex='(0[0-9]|1[0-2]):([0-5][0-9])(AM|PM|am|pm)'
# Read STDIN line by line
// Descargar: https://github.com/alvarezgarcia/provincias-argentinas-geojson
const fetch = require('node-fetch');
const fs = require('fs').promises;
async function main() {
const geojson = {
type: 'FeatureCollection',
features: [],
};
@NickCis
NickCis / README.md
Last active October 19, 2020 23:45
Correr Rmd en la consola

Hay que descargar los dos archivos en la misma carpeta y ejecutar:

chmod +x run-rmd.sh
./run-rmd.sh script.Rmd
@NickCis
NickCis / README.md
Last active December 6, 2022 16:27
Calendar Events: creating calendar events from gmail notifications e-mails.

Calendar Google APP script

La idea de este script es crear eventos del calendario como recordatorios para pagar servicios.

Necesita crear reglas en GMail para que le agregue la etiqueta calendar-event a los mails de notificaciones. El script le removerá dicha etiqueta a los mails que ya procesó.

@NickCis
NickCis / example.test.js
Created February 3, 2019 22:54
Example of jest test with custom arguments
const config = JSON.parse(process.env.__CONFIGURATION);
it('example', () => {
expect(config.custom).toEqual('command');
});
'use strict';
const config = {
custom: 'command',
flag: false,
};
const argv = process.argv.slice(0, 2);
// Naive argv parsing
process.argv
@NickCis
NickCis / runner.js
Created February 3, 2019 20:51
Jest custom command line arguments
'use strict';
const config = {
custom: 'command',
flag: false,
};
const argv = process.argv.slice(0, 2);
// Naive argv parsing
process.argv
@NickCis
NickCis / AddIdentPlugin.js
Last active October 26, 2021 14:56
Webpack - themes processing (multi import)
'use strict';
let refCounter = 0;
/** This plugin adds the options of the provided loaders to Webpack's RuleSet reference.
* This allows you to refer to this config by an `ident` name and avoid the options serialization.
*
* The simpler use case is forcing a loader by using a require query string, if the needed configuration has
* functions or not serializable objects, you'll have to use this `ident` plugin.
*
* If the provided loaders options do not have an `ident` property, one is generated.