This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"state": "PR", "zipcode": "705", "city": "AIBONITO", "lat": "18.14", "lng": "-66.26"}, {"state": "PR", "zipcode": "610", "city": "ANASCO", "lat": "18.28", "lng": "-67.14"}, {"state": "PR", "zipcode": "612", "city": "ARECIBO", "lat": "18.45", "lng": "-66.73"}, {"state": "PR", "zipcode": "729", "city": "CANOVANAS", "lat": "18.37", "lng": "-65.90"}, {"state": "PR", "zipcode": "647", "city": "ENSENADA", "lat": "17.96", "lng": "-66.94"}, {"state": "PR", "zipcode": "707", "city": "MAUNABO", "lat": "18.00", "lng": "-65.90"}, {"state": "NJ", "zipcode": "7675", "city": "WESTWOOD", "lat": "40.98", "lng": "-74.03"}, {"state": "NJ", "zipcode": "7885", "city": "WHARTON", "lat": "40.89", "lng": "-74.58"}, {"state": "NJ", "zipcode": "7095", "city": "WOODBRIDGE", "lat": "40.55", "lng": "-74.28"}, {"state": "NJ", "zipcode": "8802", "city": "ASBURY", "lat": "40.67", "lng": "-75.02"}, {"state": "NJ", "zipcode": "7827", "city": "MONTAGUE", "lat": "41.29", "lng": "-74.74"}, {"state": "NJ", "zipcode": "8201", "city": "ABSECON", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jmespath | |
def remap_fields(fieldmap, data, loader=None, *, jmes=True, **defaults): | |
'''Map data. | |
>>> remap_fields({'price': 'productPrice'}, {'productPrice': 5.00}) | |
{'price': 5.00} | |
>>> remap_fields({'price': ['producPrice', 'finalPrice']}, {'finalPrice': 5.00}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
xhost +local:docker | |
docker run \ | |
-e DISPLAY=unix$DISPLAY \ | |
-v /tmp/.X11-unix:/tmp/.X11-unix \ | |
-v $XAUTHORITY:$XAUTHORITY \ | |
-v $(pwd)/notebooks:/notebooks \ | |
-e XAUTHORITY=$XAUTHORITY \ | |
-p 8888:8888 \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const puppeteer = require('puppeteer'); | |
(async () => { | |
const browser = await puppeteer.launch({headless: false}); | |
const page = await browser.newPage(); | |
await page.goto('https://takeout.google.com/'); | |
const input = await page.evaluate(() => { | |
const next = document.querySelector('#identifierNext'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[source]] | |
url = "https://pypi.python.org/simple" | |
verify_ssl = true | |
name = "pypi" | |
[dev-packages] | |
ipython = "*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Cli utility for spliting a big XML file into smaller parts. | |
The breakpoint will be the element of depth 1 (below root) that does not | |
fit in the specified maximum size. Each part created will have the same | |
root element. | |
Usage: | |
$ xmsplit size prefix [filename] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for user in $(getent passwd | cut -f1 -d: ); do | |
crontab -u $user -l && echo $user && printf '=%.0s' {1..100} && echo ; | |
done 2> /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener("DOMContentLoaded", function(event) { | |
const faixa = document.createElement('div'); | |
const estilo = document.createElement('style'); | |
faixa.id='faixa-homologacao'; | |
faixa.textContent = 'Versão de Homologação'; | |
estilo.textContent = ` | |
#${faixa.id} { | |
margin: 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.getElementById('numbersonly').addEventListener( | |
'keypress', | |
function() { | |
var allowed_keys = { | |
48: true, // 0 | |
49: true, // 1 | |
50: true, // 2 | |
51: true, // 3 | |
52: true, // 4 | |
53: true, // 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#define INFINITO 32766 | |
#define TRUE 1 | |
#define FALSE 0 | |
#define NN 150 | |
typedef unsigned char BOOL; | |
NewerOlder