Skip to content

Instantly share code, notes, and snippets.

@sergiobuj
sergiobuj / Dockerfile_alpine
Last active February 17, 2024 10:13
troubleshoot docker ENV
FROM alpine:latest
ENV no_proxy internal.example.com,internal2.example.com
ENV NO_PROXY internal.example.com,internal2.example.com
RUN apk update && apk upgrade
## How to Use:
from radar import radar_graph
labels = ['v1', 'v2', 'v3', 'v4', 'v5', 'v6', 'v7', 'v8', 'v9']
values = [1, 1, 2, 7, 4, 0, 3, 10, 6]
optimum = [5, 3, 2, 4, 5, 7, 5, 8, 5]
radar_graph(labels, values, optimum)
@sergiobuj
sergiobuj / mask.c
Created February 7, 2012 04:28
CGEventFlag bit mask and hotkey detection
if( ((flags & kCGEventFlagMaskAlphaShift) == 0 &&
(flags & kCGEventFlagMaskShift) == 0 &&
(flags & kCGEventFlagMaskControl) == 0 &&
(flags & kCGEventFlagMaskAlternate) == 0 &&
(flags & kCGEventFlagMaskCommand) == kCGEventFlagMaskCommand &&
(flags & kCGEventFlagMaskHelp) == 0 &&
(flags & kCGEventFlagMaskSecondaryFn) == kCGEventFlagMaskSecondaryFn &&
(flags & kCGEventFlagMaskNumericPad) == kCGEventFlagMaskNumericPad &&
(flags & kCGEventFlagMaskNonCoalesced) == kCGEventFlagMaskNonCoalesced) &&
@sergiobuj
sergiobuj / index.ts
Created October 18, 2022 02:18
Testing "assemblyscript-json" to parse a custom object
import { JSON } from "assemblyscript-json/assembly";
// Parse an object using the JSON object
const payload = `
'{
"hello": "world",
"value": 24,
"pack": {
"123": {
@sergiobuj
sergiobuj / config.ini
Created September 5, 2022 21:28 — forked from nhocki/config.ini
Visa appointment (renewal)
[USVISA]
; Account and current appointment info from https://ais.usvisa-info.com
USERNAME = YOUR_EMAIL
PASSWORD = YOUR_PASSWORD
SCHEDULE_ID = YOUR_ID
MY_SCHEDULE_DATE = YYYY-MM-DD
; Spanish - Colombia
COUNTRY_CODE = es-co
; Bogotá
FACILITY_ID = 26
@sergiobuj
sergiobuj / Pueblos.ipynb
Last active February 6, 2022 04:00
Colombia - "I trained an A.I. to generate British placenames"
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sergiobuj
sergiobuj / fast_clusterpy.condor
Last active June 11, 2020 16:15
Condorfy like a pro
# RiSE Group - Sergio B
# Condor description file
Notify_user = condorjobs@sbuj.co
Universe = vanilla
Executable = /opt/python/bin/python2.7
Arguments = performance_script.py
Log = log/fast_performance.log.$(Cluster)
@sergiobuj
sergiobuj / Dockerfile
Created February 18, 2016 08:12
cl-jupyter on docker with sbcl 1.3.2
FROM buildpack-deps:jessie
RUN apt-get update -qq && apt-get install -y bzip2 wget build-essential python3-dev python3-pip unzip libzmq3-dev
RUN wget -nv http://downloads.sourceforge.net/project/sbcl/sbcl/1.3.2/sbcl-1.3.2-x86-64-linux-binary.tar.bz2
RUN wget -nv https://beta.quicklisp.org/quicklisp.lisp
RUN wget -nv https://github.com/fredokun/cl-jupyter/archive/master.zip
RUN bzip2 -cd sbcl-1.3.2-x86-64-linux-binary.tar.bz2 | tar xvf -
RUN unzip master.zip
@sergiobuj
sergiobuj / Makefile
Last active June 4, 2018 01:02
Arduino + Webduino + LED
ARDUINO_SKETCHBOOK = $(HOME)/Documents/Arduino/SKETCHBOOK
ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java
ARDMK_DIR = $(HOME)/Documents/Arduino/Arduino-Makefile
BOARD_TAG = uno
ARDUINO_PORT = /dev/cu.usb*
ARDUINO_LIBS = Ethernet Ethernet/utility SPI WebServer
include $(ARDMK_DIR)/arduino-mk/Arduino.mk
@sergiobuj
sergiobuj / Castle.xml
Created January 8, 2017 20:39 — forked from bemasher/Castle.xml
Example of parsing xml in golang.
<?xml version="1.0" encoding="UTF-8" ?>
<Data>
<Series>
<id>83462</id>
<Actors>|Nathan Fillion|Stana Katic|Molly C. Quinn|Jon Huertas|Seamus Dever|Tamala Jones|Susan Sullivan|Ruben Santiago-Hudson|Monet Mazur|</Actors>
<Airs_DayOfWeek>Monday</Airs_DayOfWeek>
<Airs_Time>10:00 PM</Airs_Time>
<ContentRating>TV-PG</ContentRating>
<FirstAired>2009-03-09</FirstAired>
<Genre>|Drama|</Genre>