Skip to content

Instantly share code, notes, and snippets.

View alejamp's full-sized avatar
:octocat:
Finishing something big

Alejandro Pirola alejamp

:octocat:
Finishing something big
View GitHub Profile
from multiprocessing import Pool
import requests
import json
from random import randrange
def get_data(url):
response = requests.get(url)
print("Perform request to {} response: {}".format(url, response.status_code))
print("elapsed time: {}".format(response.elapsed.total_seconds()))
return response.status_code
#!flask/bin/python
from main import app
#Do not add debug=True
# app.run(debug=True)
# app.run()
app.run(host='0.0.0.0', port=5000, debug=False)
@alejamp
alejamp / curp.dart
Last active November 22, 2023 19:47
Dart Mexican CURP Validation
void main() {
var res = CURP.curpValida('XXXXXXXXXXXXX');
print("Result:" + res.toString());
}
class CURP {
@alejamp
alejamp / proxy.js
Created August 5, 2018 13:27
Node.js Create the HTTPS proxy server in front of a HTTP server
var httpProxy = require('http-proxy');
var targetHost = '192.168.6.128';
var port = 8100;
var address = "192.168.0.6";
var port2 = 4100;
const fs = require('fs');
//
// Create the HTTPS proxy server in front of a HTTP server
@alejamp
alejamp / karabiner-windows-style-import.sh
Last active March 8, 2017 10:53
Karabiner configuration importer. Set Windows Programmer Keys Style in Mac OSX.
#!/bin/sh
cli=/Applications/Karabiner.app/Contents/Library/bin/karabiner
$cli set remap.copy_paste_winstyle_new_tab 1
/bin/echo -n .
$cli set remap.find_winstyle_no_term 1
/bin/echo -n .
$cli set remap.pc_style_copy_paste 1
/bin/echo -n .
db = require('riak-js').getClient()
db
.add([['catalogs', 'politics']])
.link({ bucket: 'books', keep: false })
.map(function(value) {
// ejsLog('/tmp/mapreduce', JSON.stringify(value));
value = Riak.mapValuesJson(value)[0];
return [
{