Skip to content

Instantly share code, notes, and snippets.

View agmangas's full-sized avatar

Andrés García Mangas agmangas

View GitHub Profile
@agmangas
agmangas / breg-sample-03.json
Created September 16, 2020 06:40
BREG-DCAT Data Sample 03
{
"@context": {
"adms": "http://www.w3.org/ns/adms#",
"cc": "http://creativecommons.org/ns#",
"cpsv": "http://purl.org/vocab/cpsv#",
"cv": "http://data.europa.eu/m8g/",
"dcat": "http://www.w3.org/ns/dcat#",
"dcatap": "http://data.europa.eu/r5r/",
"dcterms": "http://purl.org/dc/terms/",
"dqv": "http://www.w3.org/ns/dqv#",
@agmangas
agmangas / breg-sample-02.ttl
Created September 9, 2020 16:00
BREG-DCAT Data Sample 02
@prefix dcat: <http://www.w3.org/ns/dcat#> .
@prefix dc: <http://purl.org/dc/terms/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
<http://www.fundacionctic.org/breg-data#another-catalog>
a dcat:Catalog ;
dc:description "Another catalog description" ;
dc:identifier "Another catalog unique ID" ;
dc:title "Another catalog title" ;
@agmangas
agmangas / breg-sample-01.xml
Created September 9, 2020 16:00
BREG-DCAT Data Sample 01
<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [
<!ENTITY dct "http://purl.org/dc/terms/">
<!ENTITY foaf "http://xmlns.com/foaf/0.1/">
<!ENTITY dcat "http://www.w3.org/ns/dcat#">
<!ENTITY adms "http://www.w3.org/ns/adms#">
<!ENTITY vann "http://purl.org/vocab/vann/">
<!ENTITY cc "http://creativecommons.org/ns#">
<!ENTITY owl "http://www.w3.org/2002/07/owl#">
<!ENTITY vcard "http://www.w3.org/2006/vcard/ns#">
#include <Adafruit_NeoPixel.h>
#include <Arduino.h>
#include <Automaton.h>
const uint16_t LED_NUM_01 = 30;
const uint16_t LED_PIN_01 = 7;
const uint16_t LED_NUM_02 = 30;
const uint16_t LED_PIN_02 = 8;
const uint8_t LED_BRIGHTNESS = 180;
@agmangas
agmangas / time_app.py
Last active April 21, 2020 11:45
Time WoT App
import asyncio
import datetime
import functools
import json
import logging
import pprint
import random
import time
from wotpy.wot.enums import DataType
@agmangas
agmangas / eleccia-builder.py
Last active October 16, 2019 10:12
Eleccia Dataset Builder
import json
import math
import pprint
from pymongo import MongoClient
MONGO_URL = "mongodb://devit.fundacionctic.org:27117"
LOG_SCALE = False
SIZE_THRESHOLD = 200
@agmangas
agmangas / sl4g-routes.py
Created March 20, 2019 13:37
Script to fix SL4G VMs routing
from subprocess import Popen, PIPE
import pprint
TABLE_ALTERNATE = "alternate"
TABLE_DOCKER = "docker"
RT_TABLE_ALTERNATE = "1 {}".format(TABLE_ALTERNATE)
RT_TABLE_DOCKER = "2 {}".format(TABLE_DOCKER)
HOST_NET = "10.38.0.0/19"
@agmangas
agmangas / runebook-graph.py
Created February 19, 2019 17:28
Runebook graph script
import pprint
import random
import matplotlib.pyplot as plt
import networkx as nx
MAT_ROWS = 7
MAT_COLS = 7
MAT_SIZE = MAT_ROWS * MAT_COLS
MAT_FOLD_SIZE = 3
@agmangas
agmangas / multiproc-poc.py
Created February 19, 2019 12:09
Minimal multiprocessing PoC
import multiprocessing
import queue
import random
import time
def process_loop(input_queue, output_queue):
print("Initializing process loop")
while True:
@agmangas
agmangas / runebook-graph.py
Last active January 20, 2019 17:20
Runebook graph
import pprint
import random
import matplotlib.pyplot as plt
import networkx as nx
MAT_ROWS = 7
MAT_COLS = 7
MAT_SIZE = MAT_ROWS * MAT_COLS
MAT_FOLD_SIZE = 3