Skip to content

Instantly share code, notes, and snippets.

@NickCis
NickCis / sphixbase.yaml-spec
Created June 7, 2014 08:49
sphinxbase for sailfish OS .yaml and .spec
-------------------------- sphinxbase.yaml ------------------------------
Name: sphinxbase
Summary: Common library for sphinx speech recognition.
Version: 0.8
Release: 1
Group: System/Libraries
License: BSD
URL: http://cmusphinx.sourceforge.net/
Description: |
Common library for sphinx speech recognition.
@NickCis
NickCis / city-blocks.js
Created May 29, 2017 06:56
Get city blocks by coordinates
const fetch = require('node-fetch'),
polygonize = require('polygonize'),
interpreterUrl = 'http://overpass-api.de/api/interpreter';
function buildOverpassQL(lat, lon, around='500') {
return '[out:json];(' +
['primary', 'secondary', 'tertiary', 'residential', 'trunk'].map(
e => `way["highway"="${e}"](around:${around}, ${lat}, ${lon});`
).join('')+'); out body; >; out skel qt;';
}
@NickCis
NickCis / youtube-screenshot.js
Created July 9, 2017 19:44
Youtube Screenshot bookmarklet
javascript: !function(){var a=document.querySelector(".video-stream.html5-main-video"),b=document.createElement("canvas"),c=b.getContext("2d");b.addEventListener("click",function(){b.parentNode.removeChild(b)}),b.width=a.videoWidth,b.height=a.videoHeight,c.drawImage(a,0,0,a.videoWidth,a.videoHeight),a.parentNode.parentNode.insertAdjacentElement("afterend",b)}();
@NickCis
NickCis / export-ble-infos.py
Created January 13, 2018 21:11 — forked from Mygod/export-ble-infos.py
Export your Windows Bluetooth LE keys into Linux!
#!/usr/bin/python3
"""
Export your Windows Bluetooth LE keys into Linux!
Thanks to: http://console.systems/2014/09/how-to-pair-low-energy-le-bluetooth.html
Usage:
$ ./export-ble-infos.py <args>
$ sudo bash -c 'cp -r ./bluetooth /var/lib && service bluetooth force-reload'
@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.
@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
'use strict';
const config = {
custom: 'command',
flag: false,
};
const argv = process.argv.slice(0, 2);
// Naive argv parsing
process.argv
@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');
});
@NickCis
NickCis / README.md
Last active October 10, 2024 14:32
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ó.

// 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: [],
};