Skip to content

Instantly share code, notes, and snippets.

View headsrooms's full-sized avatar
🦊

Pablo Cabezas headsrooms

🦊
  • SNGULAR
  • Madrid
  • 13:00 (UTC +02:00)
View GitHub Profile
@Integralist
Integralist / Python API Design.md
Last active November 15, 2018 10:20
[Python API Design] #api #design #python

Rules

  1. Raise exceptions near to the source of the error.
  2. Raise custom exceptions that are a subclass of a custom parent exception.
  3. Catch the custom parent exception near the top level of your application.
  4. Return True if an otherwise impure/side-effect driven operation succeeded.
  5. Send (and document) standardized error messages (e.g. NOUN_STATE == INPUT_INVALID)
  6. Send appropriate response status codes so callers can handle errors without parsing response structure.

Example

@etienned
etienned / export.py
Created September 21, 2018 04:23
Function to export a requirements.txt from poetry
from poetry.console.application import Application
from poetry.semver import parse_constraint, VersionUnion
def export_requirements(tag=False):
app = Application()
installed_repo = app.poetry.locker.locked_repository(True)
output = []
@peillis
peillis / developer.md
Last active August 5, 2018 20:11
Doofinder developer

Python Developer

We are seeking a self-motivated and enthusiastic senior software engineer to join the Doofinder team. The Doofinder team develops since 2011 the top search engine for webs and ecommerce, that helps retailers online to increase their sales.

Python developers are responsible for developing and updating the solution. You will use a wide variety of technologies, such as Python, Django, Elixir, AWS, Machine Learning and other web technologies to improve and implement new Doofinder´s features.

We are looking for smart, innovative, and driven developers. We will consider applicants with, at least, 3-4 years experienced in the technologies listed below, however you must have strong Python skills.

Key Responsibilities:

@honewatson
honewatson / elm.nim
Created July 4, 2018 13:33
Nim Karax Elm Architecture Example
include karax / prelude
import strutils
type
Model = object
counter*: int
Dispatch = proc(model: Model): void
proc init(): Model =
result = Model(counter: 0)
@apahl
apahl / nim_magic.py
Last active October 21, 2019 13:53
Nim cell magic for Jupyter and JLab Notebooks
"""
nim_magic.py
Jupyter cell magic for your favorite programming language.
This is now also available as a proper repo:
https://github.com/apahl/nim_magic
All further changes will be tracked there.
Requirements: Nim (https://nim-lang.org), nimpy (`nimble install nimpy`, thanks to @yglukhov for this great library!)
@swalkinshaw
swalkinshaw / tutorial.md
Last active February 26, 2025 21:15
Designing a GraphQL API
@ylogx
ylogx / xgboost_incremental.ipynb
Last active May 25, 2024 22:10
XGBoost Incremental Learning
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Morreski
Morreski / timed_cache.py
Last active May 15, 2025 01:49
Python lru_cache with timeout
from datetime import datetime, timedelta
import functools
def timed_cache(**timedelta_kwargs):
def _wrapper(f):
update_delta = timedelta(**timedelta_kwargs)
next_update = datetime.utcnow() + update_delta
# Apply @lru_cache to f with no cache size limit
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Eucrow
Eucrow / pyenv_python_django_gunicorn_circus_nginx.md
Last active August 7, 2022 15:01
pyenv + python + django + gunicorn + circus + nginx in ubuntu 16.04

pyenv + python + django + gunicorn + circus + nginx in ubuntu 16.04

Install dependencies (TODO: check dependencies)

sudo apt-get install -y postgresql-9.5 postgresql-contrib-9.5 postgresql-server-dev-9.5 nginx git circus make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils python-setuptools

Users

Create user for the app

sudo adduser app