Skip to content

Instantly share code, notes, and snippets.

View sanjmen's full-sized avatar
viento en popa a toda vela

Santiago Mendez sanjmen

viento en popa a toda vela
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
[{"ID":"thsOfugG","Name":"device_0","Active":false,"Geometry":{"Type":"Point","Coordinates":[-3.1002761187152714,-44.73816434283549]},"Share":"https://stlk.it/thsOfugG","Date":"2019-06-18T22:15:37+02:00","Temperature":8.11,"Battery":0.31},{"ID":"HmAjscDv","Name":"device_1","Active":true,"Geometry":{"Type":"Point","Coordinates":[-11.039520349683386,-79.53915383342887]},"Share":"https://stlk.it/HmAjscDv","Date":"2019-05-28T18:05:12+02:00","Temperature":34.32,"Battery":0.76},{"ID":"gSKmTTcx","Name":"device_2","Active":true,"Geometry":{"Type":"Point","Coordinates":[1.9862382370439349,102.25265679798002]},"Share":"https://stlk.it/gSKmTTcx","Date":"2019-02-19T00:24:43+01:00","Temperature":13.04,"Battery":0.01},{"ID":"YYZDXONV","Name":"device_3","Active":false,"Geometry":{"Type":"Point","Coordinates":[21.983652824877353,-49.18198206602062]},"Share":"https://stlk.it/YYZDXONV","Date":"2019-04-30T09:44:04+02:00","Temperature":28.38,"Battery":0.24},{"ID":"PObIbcBW","Name":"device_4","Active":false,"Geometry":{"Type":"Po
@sanjmen
sanjmen / nes.py
Created March 5, 2020 19:04 — forked from karpathy/nes.py
Natural Evolution Strategies (NES) toy example that optimizes a quadratic function
"""
A bare bones examples of optimizing a black-box function (f) using
Natural Evolution Strategies (NES), where the parameter distribution is a
gaussian of fixed standard deviation.
"""
import numpy as np
np.random.seed(0)
# the function we want to optimize
@sanjmen
sanjmen / redis_key_sizes.sh
Created February 12, 2020 08:06 — forked from epicserve/redis_key_sizes.sh
A simple script to print the size of all your Redis keys.
#!/usr/bin/env bash
# This script prints out all of your Redis keys and their size in a human readable format
# Copyright 2013 Brent O'Connor
# License: http://www.apache.org/licenses/LICENSE-2.0
human_size() {
awk -v sum="$1" ' BEGIN {hum[1024^3]="Gb"; hum[1024^2]="Mb"; hum[1024]="Kb"; for (x=1024^3; x>=1024; x/=1024) { if (sum>=x) { printf "%.2f %s\n",sum/x,hum[x]; break; } } if (sum<1024) print "1kb"; } '
}
@sanjmen
sanjmen / gist:aed75df9833480fdbd264164ca6627ec
Created February 11, 2020 13:54 — forked from mikeyk/gist:1329319
Testing storage of millions of keys in Redis
#! /usr/bin/env python
import redis
import random
import pylibmc
import sys
r = redis.Redis(host = 'localhost', port = 6389)
mc = pylibmc.Client(['localhost:11222'])
@sanjmen
sanjmen / fwi.md
Last active August 4, 2025 14:24
Canadian Forest Fire Weather Index calculator

Canadian Forest Fire Weather Index calculator

Description

This project is a set of functions for calculating the Canadian Forest Fire Weather Index (FWI), a Canadian Forest Service system to compute codes for fire behavior and emissions from weather. The FWI is described in detail in Van Wagner 1987. It also includes equations for computing % moisture content from the Duff Moisture Code (DMC) and a batch csv calculator for FWI. The README file that comes with the source covers installation and usage examples. A sample csv file is also provided. The FWI functions were directly translated from the Southeast Asia Fire Danger Rating System Project Excel Plugin. The DMC to % moisture functions are from Lawson et al 1997, who followed Van Wagner 1987 for DMC conversion.

References

@sanjmen
sanjmen / requirements.txt
Last active May 29, 2019 17:36
requirements to read meteo and weather data
black==19.3b0
pylint==2.3.1
ipython==7.5.0
notebook==5.7.8
jupyter==1.0.0
PyQt5==5.12.2
dask==1.2.2
Cython==0.29.7
numpy==1.16.3
pandas==0.24.2
@sanjmen
sanjmen / smn-data
Created March 23, 2019 17:43
exploring smn weather data
base_url = "https://ssl.smn.gob.ar/dpd/descarga_opendata.php?file="
first_date = "20171126"
"""
Datos horarios
Dato meteorológico de todas las estaciones de superficie del país
Datos de temperatura, presión, viento y humedad de las estaciones meteorológicas de todo el país.
"""
path_datos_horarios = "observaciones/datohorario{}.txt".format(date)