Skip to content

Instantly share code, notes, and snippets.

... 🐝 ... 🐝 ... 🐝 ... 🐝

Eleni Lixourioti Geekfish

... 🐝 ... 🐝 ... 🐝 ... 🐝
Block or report user

Report or block Geekfish

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Geekfish / Leo-Anki.js
Last active Feb 8, 2019 — forked from fbecart/Leo-Anki.js
Bookmarklet to export Leo Trainer words to an Anki deck.
View Leo-Anki.js
* This bookmarklet makes it possible to transfer words from Leo Trainer to Anki.
* It only works for fr-de translations. Contact me for other languages.
* Prerequisites:
* - a Leo account ( with a few words saved in the trainer
* - an Anki account (
* 1. Crunch the following code and add it to your bookmarks
* 2. Run the bookmarklet on this page
Geekfish /
Last active Jan 27, 2019
Straight into the interpreter, vs in function
$ python3
Python 3.7.0 (default, Jul 23 2018, 20:24:19)
[Clang 9.0.0 (clang-900.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> class C():
... def __init__(self, i):
... print(f"contructing {i}")
... self.i = i
... def __del__(self):
... print(f"deleting {self.i}")
Geekfish /
Last active Jan 2, 2019
Inspect mounted volumes in docker containers
docker ps -q | xargs -I '{}' docker inspect {} | jq '.[] | {container_id: .Id, image: .Config.Image, mounts: .Mounts}'
def comma_comma_and(_list, conj=u"and"):
Accepts a list of strings and returns a single string, stitching it all
comma_comma_and(["Papa Bear", "Mama Bear", "Baby Bear"])
# > "Papa Bear, Mama Bear, and Baby Bear"
comma_comma_and(["Chocolate", "cake", "ice-cream"], conj="or")
Geekfish /
Last active Dec 12, 2018
Ticket in commit msg (Github and CodebaseHQ versions)

This is a hook that adds the ticket number to the commit message, if it can be infered by the branch name. (ex. branch name bugfix/5234-fix-a-thing would result in #5234 for the github version or [t: 5234] for the codebase version.


Show the SQL executed by a migration:

python sqlmigrate <appname> <migration no eg. 0001 or 0004>

Generate a signing key:

import random, string
Geekfish /
Last active Dec 21, 2018
Same as patch, but allows you to pass a module object which will be reloaded when entering/leaving the context.
import imp
from functools import partial
from mock.mock import _patch, _get_target, DEFAULT
class PatchWithReload(_patch):
def __init__(self, module_to_reload, *args, **kwargs):
self.module_to_reload = module_to_reload
super(PatchWithReload, self).__init__(*args, **kwargs)
Geekfish /
Last active Jan 7, 2019
DjangoRQ Transaction aware job decorator
from jobs import send_welcome_email
# ...
def register_user():
user = do_the_registration()
# or
# send_welcome_email.request_aware_delay(
Geekfish /
Created Oct 31, 2017
Transaction Aware Celery Task - SQLAlchemy
# Based on Django version found here:
from celery import Task
from sqlalchemy import event
from some_module import DBSession
class TransactionAwareTask(Task):
Geekfish / Contract Killer
Created Jul 12, 2017 — forked from malarkey/Contract Killer
The latest version of my ‘killer contract’ for web designers and developers
View Contract Killer

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

You can’t perform that action at this time.