This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"type":{"Spectral":"div","RdYlGn":"div","RdBu":"div","PiYG":"div","PRGn":"div","RdYlBu":"div","BrBG":"div","RdGy":"div","PuOr":"div","Set2":"qual","Accent":"qual","Set1":"qual","Set3":"qual","Dark2":"qual","Paired":"qual","Pastel2":"qual","Pastel1":"qual","OrRd":"seq","PuBu":"seq","BuPu":"seq","Oranges":"seq","BuGn":"seq","YlOrBr":"seq","YlGn":"seq","Reds":"seq","RdPu":"seq","Greens":"seq","YlGnBu":"seq","Purples":"seq","GnBu":"seq","Greys":"seq","YlOrRd":"seq","PuRd":"seq","Blues":"seq","PuBuGn":"seq"},"Spectral":{"3":[[153,213,148],[255,255,191],[252,141,89]],"4":[[43,131,186],[171,221,164],[253,174,97],[215,25,28]],"5":[[43,131,186],[171,221,164],[255,255,191],[253,174,97],[215,25,28]],"6":[[50,136,189],[153,213,148],[230,245,152],[254,224,139],[252,141,89],[213,62,79]],"7":[[50,136,189],[153,213,148],[230,245,152],[255,255,191],[254,224,139],[252,141,89],[213,62,79]],"8":[[50,136,189],[102,194,165],[171,221,164],[230,245,152],[254,224,139],[253,174,97],[244,109,67],[213,62,79]],"9":[[50,136,189],[102,194 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This demonstrates using tox to test different Python versions and different library versions on select Python versions. | |
# TODO: use asdf, pyenv, Dockerfile to install many py versions | |
# Dependencies: aiohttp | |
# Dev dependencies: pytest pytest-asyncio pytest-cov tox tox-pyenv | |
[tox] | |
envlist = | |
# The oldest Python version we support | |
# 3.7 is EOL and 3.8 only has 1 more year of security updates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function resolve_hostname(hostname) | |
local dns_resolver_lib = require("resty.dns.resolver") | |
local dns_resolver, dns_resolver_err = dns_resolver_lib:new({ | |
-- Kubernetes default nameserver IP | |
-- If your hostnames are public, try Google's DNS nameserver 8.8.8.8 | |
nameservers = {"kube-dns.kube-system.svc.cluster.local"}, | |
-- 250 milliseconds | |
timeout = 250, | |
retrans = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See updates here: github.com/roguh/gdsfactory_nand2tetris.git | |
# python 3.11 support. unit tests seem ok, may need some reference GDS files | |
# download https://gdsfactory.github.io/skywater130/ (sky130 package) but make sure to use laatest version of gdsfactory, run `make install` | |
# `pip install gdsfactory[full,dev]` | |
# use https://github.com/gdsfactory/kweb for visualization | |
# put file x.gds into gds_files and navigate to localhost:8000/gds/x to see it | |
# TODO: list gds files at homepage /, route should be /gds_files/x with /gds_files/x.gds redirect | |
# gdsthing.plot_matplotlib() is slow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "Afghanistan", | |
"code": "AF" | |
}, | |
{ | |
"name": "Åland Islands", | |
"code": "AX" | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from redis.sentinel import Sentinel | |
def connect_to_redis(address: str, port: int, redis_set: str): | |
sentinel = Sentinel([(address, port)], socket_timeout=0.5) | |
con = sentinel.master_for( | |
redis_set, | |
decode_responses=True, | |
socket_timeout=0.5, | |
) | |
con.echo("test") | |
return con |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import fileinput | |
import json | |
import re | |
import sys | |
from argparse import ArgumentParser | |
from dataclasses import dataclass | |
from pprint import pprint | |
from typing import Any, Dict, List, Optional, Union |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const env = require('env-var') | |
const Timeout = require('await-timeout') | |
const { connect, JSONCodec } = require('nats') | |
const NATS_AUTH_TOKEN = env | |
.get('NATS_AUTH_TOKEN') | |
.required() | |
.asString() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install the digi-xbee package | |
import binascii | |
import json | |
import os | |
import pprint | |
import time | |
from digi.xbee.devices import XBeeDevice | |
from digi.xbee.models.address import XBee64BitAddress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hugo O Rivera is roguh.com | |
roguh is Hugo Rivera | |
Hugo O Rivera |
NewerOlder