Skip to content

Instantly share code, notes, and snippets.


Stratos Gerakakis stratosgear

View GitHub Profile
singulared /
Created February 12, 2020 15:37
swaylock with image per-output
# Dependencies:
# imagemagick
# swaylock
# grim
nilayk / Google Ad Highlighter.user.js
Last active March 24, 2023 20:07
Tampermonkey Script - Google Ad Highlighter
View Google Ad Highlighter.user.js
// ==UserScript==
// @name Google Ad Highlighter
// @namespace
// @version 1.1
// @description Highlight Google Ads in search results
// @author Nilay Khandelwal
// @include **
// @downloadURL
// @grant GM_addStyle
// ==/UserScript==
kekru /
Last active May 6, 2023 07:29
Traefik redirect / (root) to sub path with Docker labels

Traefik: redirect base or root path to a subpath

This is tested with Traefik 1.7

This is how to redirect the root or base path to a sub path in Traefik using Docker labels:

  • ->
  • ->
  • -> no redirect
mattbennett /
Created April 14, 2017 15:00
Nameko Auth Toy
from nameko.standalone.rpc import ClusterRpcProxy
config = {
'AMQP_URI': 'amqp://guest:guest@localhost:5672/'
with ClusterRpcProxy(config) as rpc:
session_token = rpc.auth.login("admin", "secret")
with ClusterRpcProxy(config, context_data={'session': session_token}) as rpc:
lkrone /
Created December 16, 2016 22:43
Shows a way to generate a PDF (with Python and ReportLab) of a sheet of labels containing EAN-13 Barcodes and a short, descriptive text.
#!/usr/bin/env python3
from reportlab.lib.pagesizes import A4
from import Drawing, String
from import Ean13BarcodeWidget
from import renderPDF
from reportlab.pdfgen.canvas import Canvas
Adjust pagesize, number of labels, barcode size and
JamesMGreene /
Last active May 30, 2023 14:12
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.


gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

cdiener /
Created April 13, 2014 03:11 now with documentation
# This line imports the modules we will need. The first is the sys module used
# to read the command line arguments. Second the Python Imaging Library to read
# the image and third numpy, a linear algebra/vector/matrix module.
import sys; from PIL import Image; import numpy as np
# This is a list of characters from low to high "blackness" in order to map the
# intensities of the image to ascii characters
chars = np.asarray(list(' .,:;irsXA253hMHGS#9B&@'))
# Check whether all necessary command line arguments were given, if not exit and show a
jhorman /
Last active April 13, 2022 12:39
Redis semaphore implemented in Python via zsets. Lock expiration is implemented by only scanning the zset for items within a time range.
from __future__ import absolute_import
from time import time, sleep
import uuid
class RedisSemaphore(object):
Redis base semaphore. Supports timeouts of semaphore locks.
DaRaFF /
Last active March 12, 2023 21:49
Ubuntu php development environment

#Introduction If you're a php developer on ubuntu, there comes the time where you have to install/reinstall your system. I did it already a few times and i decided to write down the steps for a typical web developer stack with php. This is for a developer machine and not for a live environment!

I hope it helps you too!

fyi @mheiniger and me started with an installer here:

datagrok / gist:2199506
Last active April 8, 2023 17:36
Virtualenv's `bin/activate` is Doing It Wrong
View gist:2199506