Skip to content

Instantly share code, notes, and snippets.

View scorphus's full-sized avatar
Brewing at 🏡 office

Pablo Aguiar scorphus

Brewing at 🏡 office
View GitHub Profile
@scorphus
scorphus / gh-dl-release
Created July 24, 2018 16:14 — forked from maxim/gh-dl-release
Download assets from private Github releases
#!/usr/bin/env bash
#
# gh-dl-release! It works!
#
# This script downloads an asset from latest or specific Github release of a
# private repo. Feel free to extract more of the variables into command line
# parameters.
#
# PREREQUISITES
#
@scorphus
scorphus / Dockerfile
Last active February 23, 2019 18:15
HackIllinois 2019
FROM denismakogon/gocv-alpine:4.0.1-buildstage
RUN apk update && apk add brotli-dev expat-dev
RUN cd && \
curl -L https://github.com/libvips/libvips/releases/download/v8.7.4/vips-8.7.4.tar.gz | tar xz && \
cd vips-8.7.4 && ./configure && make && make install && \
curl -L https://raw.githubusercontent.com/golang/dep/master/install.sh | sh && \
go get -u -d gocv.io/x/gocv && \
go get github.com/aldor007/mort/cmd/mort
@scorphus
scorphus / requirements.txt
Last active April 3, 2019 19:59
Packages installed in a scenario that seemingly reproduces https://github.com/Microsoft/python-language-server/issues/869
alabaster==0.7.12
appnope==0.1.0
arrow==0.12.1
atlassian-python-api==1.11.19
atomicwrites==1.3.0
attrs==17.4.0
autopep8==1.4.3
aws-sam-cli==0.6.2
aws-sam-translator==1.8.0
Babel==2.6.0
@scorphus
scorphus / Lua-logo-nolabel.svg
Last active June 22, 2020 13:52
HackIllinois 2020
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@scorphus
scorphus / PythonGotchas.pdf
Last active April 26, 2020 16:28
Python Gotchas talk at Remote Python Pizza on 25/05/2020
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@scorphus
scorphus / playground.rs
Created October 11, 2020 22:30
All possible combinations of shades and opacities
fn main() {
for shade in 0..242 {
let opacity = 13f32 / (255f32 - shade as f32);
println!("opacity:{:0.3};fill:#{:06x}", opacity, shade * 65793);
}
}
@scorphus
scorphus / pattern_matching.py
Created February 18, 2021 23:10
Pattern Matching in Python
with open("/usr/share/dict/words") as words:
for word in map(str.rstrip, words):
for letter in word:
match letter:
case "a" | "b" | "c" | "d" | "e" | "f":
continue
case _:
break
else:
print(word)
@scorphus
scorphus / application.py
Created April 2, 2021 15:56
Hacking FastAPI + Redoc
from openapi import get_redoc_html
def serve_docs_route():
return get_redoc_html("openapi_url", "title")
@scorphus
scorphus / mobprog.md
Last active January 24, 2022 19:09
The Dynamics of Mob Programming

The Dynamics of Mob Programming

In a nutshell

![dynamics of mob programming][mobprog.svg]

Before you start:

  • Make sure you have [whatchexec][] installed
  • Checkout the working branch
@scorphus
scorphus / shortest_reach.ex
Created August 7, 2023 19:43
Breadth First Search: Shortest Reach
defmodule ShortestReach do
def main do
IO.gets("")
|> String.trim()
|> String.to_integer()
|> shortest_reach()
end
defp shortest_reach(0) do
end