Skip to content

Instantly share code, notes, and snippets.

@mgoodness
mgoodness / helm-rbac.md
Last active Oct 30, 2021
Helm RBAC setup for K8s v1.6+ (tested on minikube)
View helm-rbac.md
kubectl -n kube-system create sa tiller
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
helm init --service-account tiller
@fmder
fmder / elastic_transform.py
Last active Aug 22, 2021
Elastic transformation of an image in Python
View elastic_transform.py
import numpy
from scipy.ndimage.interpolation import map_coordinates
from scipy.ndimage.filters import gaussian_filter
def elastic_transform(image, alpha, sigma, random_state=None):
"""Elastic deformation of images as described in [Simard2003]_.
.. [Simard2003] Simard, Steinkraus and Platt, "Best Practices for
Convolutional Neural Networks applied to Visual Document Analysis", in
@jhgaylor
jhgaylor / through_relationships.py
Last active Aug 4, 2022
Example of using a through model in Django and filtering by a value on the custom through model.
View through_relationships.py
class A(models.Model):
things = models.ManyToManyField("B", through=ThroughModel)
class B(models.Model):
text = models.TextField()
class ThroughModel(models.Model):
a = models.ForeignKey(A)
b = models.ForeignKey(B)
extra = models.BooleanField()
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@p01
p01 / LICENSE.txt
Last active Jun 15, 2022 — forked from 140bytes/LICENSE.txt
Sudoku Solver in 140bytes
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathieu 'p01' Henri - http://www.p01.org/releases/
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE