Skip to content

Instantly share code, notes, and snippets.

View categulario's full-sized avatar
🚲
Always remote

Abraham Toriz Cruz categulario

🚲
Always remote
View GitHub Profile
@categulario
categulario / sum.py
Created July 21, 2018 01:02
Lee información de facturas en formato cfdi 3.3 y suma los impuestos
from xml.dom.minidom import parse
import os
import sys
def main():
if len(sys.argv) < 2:
exit('Usage: sum.py folder-with-xmls')
dirname = sys.argv[1]
@categulario
categulario / stops.geojson
Created October 17, 2018 03:22
Paradas de xalapa
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@categulario
categulario / collaborators.grahpql
Created November 1, 2018 17:47
People you have collaborated with; Personas con las que has colaborado
# Type queries into this side of the screen, and you will
# see intelligent typeaheads aware of the current GraphQL type schema,
# live syntax, and validation errors highlighted within the text.
# We'll get you started with a simple query showing your username!
query {
viewer {
repositories(first:100, ownerAffiliations:[OWNER]) {
nodes {
name
set encoding=utf-8
scriptencoding utf-8
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'vim-scripts/Align'
@categulario
categulario / export.py
Created January 9, 2019 16:51
QGis python script that exports all layers to CSV in the given directory
import os
dirname = "/tmp/csv" # adjust this
for vLayer in iface.mapCanvas().layers():
QgsVectorFileWriter.writeAsVectorFormat(
vLayer,
os.path.join(dirname, vLayer.name() + ".csv"),
"utf-8",
vLayer.crs(),
@categulario
categulario / neural.rs
Created February 1, 2019 01:40
Sample rust file
struct Matrix {
contents: Vec<f64>,
filas: usize,
columnas: usize,
}
impl Matrix {
fn new(filas: usize, columnas: usize) {
Matrix {
}
@categulario
categulario / organize.py
Created June 12, 2019 16:15
Toma mi archivo de strava y organízalo por mes para subir a nextcloud
#!/usr/bin/env python3
import subprocess
import csv
import os
from datetime import datetime
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
OUT_DIR = os.path.join(BASE_DIR, 'output')
@categulario
categulario / apicrud.service
Created June 12, 2019 22:45
Ejemplo de una unidad systemd
[Unit]
Description=El servicio de la aplicación flask del curso
After=network.target
[Service]
User=infopata
Group=infopata
WorkingDirectory=/home/infopata/Proyectos/APIRest/
ExecStart=/ruta/hacia/node index.js
Restart=always
@categulario
categulario / suma.py
Created June 27, 2019 20:37
Suma 39 y 47
import hashlib
h = hashlib.new('md5')
h.update(b"39")
new = (h.hexdigest() + '+47').encode()
h = hashlib.new('md5')
h.update(new)
@categulario
categulario / index.html
Created July 24, 2019 22:27
an example of overriding a css variable using a media query
<!doctype html>
<html>
<head>
<meta charset="utf8" />
<style>
:root {
--thing-color: blue;
}
#cosa {