Skip to content

Instantly share code, notes, and snippets.

View avdata99's full-sized avatar
:electron:
laburanding

Andres Vazquez avdata99

:electron:
laburanding
View GitHub Profile
@avdata99
avdata99 / envido.py
Last active February 12, 2022 21:12
"""
La funcion envido, dada una lista de (estrictamente) tres cartas,
me devuelve el envido de esa mano de truco.
Cada elemento de la lista es de la forma:
carta = {'palo': 'xxx', 'numero': N}
"""
def carta_simple_envido(carta):
""" de una carta data obtiene cuanto suma al envido
# add the repo with the driver
git clone git@github.com:nealey/hdjd.git
# install requirements
sudo apt install libusb libusb-1.0.0 libusb-1.0.0-dev libusb-dev libusb-1.0-0-dev libasound2-dev mixxx
# build the drivers
cd hdjd/
make clean all
git ls-files | \
while read f; do \
git blame -w -M -C -C --line-porcelain "$f" | \
grep -I '^author-mail '; \
done | cut -f2 -d'<' | cut -f1 -d'>' | sort -f | uniq -ic | sort -n
{
"swagger": "2.0",
"info": {
"version": "1.0.0",
"title": "Sigeva API"
},
"basePath": "/v1",
"schemes": [
"http",
"https"
#######################################
#### CARGAR MAPAS DESDE DISTINTOS GEOSERVICIOS ######################
##################################################################
rm(list=ls())
library(sf)
"""
Compare a data.json file with a google drive CSV
"""
import csv
import json
import os
import requests
def clean_url(url):
import json
import os
import requests
from slugify import slugify
instance_url = 'https://ckan.io'
package_list_url = 'api/3/action/package_list'
package_show_url = 'api/3/action/package_show'
expected_topics = [
@avdata99
avdata99 / annotate-image.sh
Created December 23, 2019 02:16
Add text to and image with imagemagick
# https://imagemagick.org/Usage/annotating/
original_image=$1
txt=$2 # texto a anotar
x1=$3 # Coord X (pixeles) donde empieza a escribir
y1=$4 # Coord Y (pixeles) donde empieza a escribir
color=$5 # ej 8808
prefix=$6 # prefijo del nombre de archivo
convert $1 \
// requiere en variable map el mapa de google
function separar_superpuestos(round_decs=7) {
// revisar todo el mapa y detectar puntos superpuestos (o cercanos segun round de lat y lng)
let to_round = Math.pow(10, round_decs);
map.data.forEach(function(feature){
let geom = feature.getGeometry();
if (geom != null) {
@avdata99
avdata99 / huawei-to-adb-devices.sh
Last active August 30, 2018 01:29
Agregar Huawei a mis adb devices
# El ID dew huawei es 12d1
echo "0x12d1" > ~/.android/adb_usb.ini
# ver donde esta el dispositivo (conectado vua USB)
lsusb
# Bus 001 Device 009: ID 12d1:107e Huawei Technologies Co., Ltd.
# ver los pemisos
ls /dev/bus/usb/001/009
sudo chmod 666 /dev/bus/usb/001/009