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 / README.md
Last active September 3, 2023 18:10
Haystack brew formula in the works

Homebrew Formula for Haystack

Installing the Formula

  1. Copy it to the Formula/h subdirectory of the homebrew/core repository. Use the following command to display the path of such repository on the file system:

    brew --repository homebrew/core
    
diff --git a/setup.py b/setup.py
index 4e6d848..b20b920 100644
--- a/setup.py
+++ b/setup.py
@@ -11,7 +11,7 @@ with open(os.path.join(_BASE_DIR, 'README.md')) as readme_file:
setup(
name='boilerpy3',
version=__version__,
- python_requires='>=3.6.*',
+ python_requires='>=3.6',
@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
@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 / 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 / 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 / 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 / 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 / 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 / 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