Skip to content

Instantly share code, notes, and snippets.

Working from home

Grokzen Grokzen

Working from home
  • Dynamist (
  • Sweden
View GitHub Profile
View gist:affc6c37715c80e24932325c3872ef59
# extras.urls
# Custom Field choices
router.register(r'_custom_field_choices', views.CustomFieldChoicesViewSet, base_name='field-choice')
# extras.api.views
class CustomFieldChoicesViewSet(ViewSet):
View pipeline test
#!/usr/bin/env python
import rediscluster
import uuid
import sys
import time
def create_connection():
startup_nodes = [
{'host': '', 'port': 7000},
{'host': '', 'port': 7001},
Grokzen / reclaimWindows10.ps1
Created Jan 8, 2017 — forked from alirobe/reclaimWindows10.ps1
"Reclaim Windows 10" turns off a bunch of unnecessary Windows 10 telemetery, removes bloatware, and privacy invasions. Review and tweak before running. Scripts for reversing are included and commented. Fork via (different defaults)
View reclaimWindows10.ps1
# Win10 Initial Setup Script
# Author: Disassembler <>
# Version: 1.7, 2016-08-15
# dasm's script:
# This script leaves more MS defaults on, including MS security features.
# Tweaked based on personal preferences for @alirobe 2016-11-16 - v1.7.1
View gist:8109ef4c0b4fb149e8ee
@@ -397,7 +400,8 @@ class StrictRedis(object):
charset=None, errors=None,
decode_responses=False, retry_on_timeout=False,
ssl=False, ssl_keyfile=None, ssl_certfile=None,
- ssl_cert_reqs=None, ssl_ca_certs=None):
+ ssl_cert_reqs=None, ssl_ca_certs=None,
+ max_connections=None):
if not connection_pool:
if charset is not None:
Grokzen /
Last active Jun 26, 2020
Symmetrical ManyToMany Filter Horizontal in Django Admin
# Based on post from:
# Only reposting to avoid loosing it.
When adding a many-to-many (m2m) relationship in Django, you can use a nice filter-style multiple select widget to manage entries. However, Django only lets you edit the m2m relationship this way on the forward model. The only built-in method in Django to edit the reverse relationship in the admin is through an InlineModelAdmin.
Below is an example of how to create a filtered multiple select for the reverse relationship, so that editing entries is as easy as in the forward direction.
### pizza/ ###
Grokzen / sp
Last active Aug 29, 2015 — forked from wandernauta/sp
View sp
# This is sp, the command-line Spotify controller. It talks to a running
# instance of the Spotify Linux client over dbus, providing an interface not
# unlike mpc.
# Put differently, it allows you to control Spotify without leaving the comfort
# of your command line, and without a custom client or Premium subscription.
Grokzen /
Created Jul 10, 2013
Tiny lib that will perform a simple version of fuzzy string matching, similar to what sublime text use.
import difflib
def match(key, search_for):
a = [char for char in search_for]
index = 0
for char in key:
if a[index] == char:
index += 1
if index == len(a):
You can’t perform that action at this time.