Skip to content

Instantly share code, notes, and snippets.

View patrick91's full-sized avatar

Patrick Arminio patrick91

View GitHub Profile
@doctorpangloss
doctorpangloss / repetition_algorithm.ipynb
Last active November 23, 2023 19:13
Supermemo 2 Algorithm, Unobscured (Python 3)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@seanhandley
seanhandley / docker-compose.yml
Last active January 23, 2025 09:49
How To Set Up Docker For Mac (Mojave) with Native NFS
version: '2'
services:
api:
volumes:
- "nfsmount:${CONTAINER_DIR}"
volumes:
nfsmount:
driver: local
driver_opts:
@alexcasalboni
alexcasalboni / aws-lambda-static-type-checker.md
Last active May 22, 2023 07:31
AWS Lambda Static Type Checker Example (Python3)

How to use Python3 Type Hints in AWS Lambda

TL;DR

Static Type Checkers help you find simple (but subtle) bugs in your Python code. Check out lambda_types.py and incrementally improve your code base and development/debugging experience with type hints.

Your Lambda Function code will go from this:

@omaraboumrad
omaraboumrad / splitlogs.py
Created October 6, 2017 14:18
View docker-compose services logs in split tmux panes
# Requires pyyaml
import os
import yaml
run = os.system
new_window = lambda cmd: run('tmux new-window -n "logs" "{}"'.format(cmd))
split_vertical = lambda cmd: run('tmux split-window "{}"'.format(cmd))
split_horizontal = lambda cmd: run('tmux split-window -h "{}"'.format(cmd))
even_vertical = lambda: run('tmux select-layout even-vertical')
@kitten
kitten / reactiveconf-sc-cfp.md
Last active November 17, 2020 15:06
ReactiveConf 2017 Lightning Talk CFP: With styled-components into the future

styled-components Logo

With styled-components into the future

Preprocessing is dead, long live preprocessing!


This is a CFP for ReactiveConf 2017's open call for Lightning talks. If you'd like to see this talk become a reality, please ⭐ star this gist. #ReactiveConf

@appeltel
appeltel / pubsub.py
Last active November 27, 2024 18:36
asyncio pubsub example
import asyncio
import random
class Hub():
def __init__(self):
self.subscriptions = set()
def publish(self, message):
@manelclos
manelclos / s3signurl.py
Last active February 9, 2018 19:23 — forked from obeattie/s3signurl.py
Quick, dirty Python script that spits out a signed url for Amazon S3
#!/usr/bin/env python
import optparse
import sys
import os
os.environ['S3_USE_SIGV4'] = 'True'
from boto.s3.connection import S3Connection
def sign(bucket, path, access_key, secret_key, https, expiry, host=None):
@paulirish
paulirish / what-forces-layout.md
Last active April 3, 2025 02:13
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@fffabs
fffabs / Preferences.sublime-text.json
Created December 20, 2013 17:26
SublimeText 3 User Preferences
{
//
// Fonts
"font_face": "Monaco",
"font_options":"subpixel_antialias",
"font_size": 11.0,
"bold_folder_labels":true,
"line_padding_bottom":1,
"line_padding_top":1,
"word_separators": "./\\()\"'-:,.;<>~!@$%^&*|+=[]{}`~?", // Remove '#'