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 / 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 / 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 / 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 / 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 / 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
@categulario
categulario / stops.geojson
Created October 17, 2018 03:22
Paradas de xalapa
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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]
#!/bin/bash
res=`python -c "
a=1
a+=1
print(a)
"`
echo $res
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'
data = [
"44013001",
"44042099",
"44071001",
"44071002",
"44072101",
"44072102",
"44072199",
"44072201",
"44072299",