Skip to content

Instantly share code, notes, and snippets.

View avukonke's full-sized avatar

Avukonke Peter avukonke

  • The Internet
  • Cape Town, South Africa
View GitHub Profile
@honzakral
honzakral / search.py
Last active March 11, 2021 09:47
Super simple inverted index in Python
import re
from collections import defaultdict, Counter
def bold(txt):
return '\x1b[1m%s\x1b[0m' % txt
DATA = [
{
'title': 'Django',
'description': 'Django is a high-level Python Web framework that '
@olejon
olejon / Install Spotify 0.9 on Fedora 64-bit
Last active December 1, 2024 12:49
Install Spotify 0.9 on Fedora 64-bit
# NOTES
# Spotify 0.9 vs 1.0 is stable, uses less resources overall and works well with Spotify Connect, SpotCommander, Local Files etc
# Tested and works on Fedora 29 64-bit with GNOME, but should work on previous versions as well
# The sources of the Dropbox files, which are hosted by me and the latest and greatest available, are listed above each one
# No system files will be overwritten by these or used by other programs since they depend on the later Fedora versions
# Make sure you copy the whole lines into Terminal
# Each command is on one line and might be long
# START GUIDE
@ericelliott
ericelliott / essential-javascript-links.md
Last active February 23, 2026 21:20
Essential JavaScript Links
@Nagyman
Nagyman / workflows-in-django.md
Last active November 20, 2024 01:08
Workflows in Django

Workflows (States) in Django

I'm going to cover a simple, but effective, utility for managing state and transitions (aka workflow). We often need to store the state (status) of a model and it should only be in one state at a time.

Common Software Uses

  • Publishing (Draft->Approved->Published->Expired->Deleted)
@kennethreitz
kennethreitz / 0_urllib2.py
Created May 16, 2011 00:17
urllib2 vs requests
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
gh_url = 'https://api.github.com'
req = urllib2.Request(gh_url)
password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm()