Skip to content

Instantly share code, notes, and snippets.

View zbyte64's full-sized avatar

Jason Kraus zbyte64

View GitHub Profile
@zbyte64
zbyte64 / sample.py
Created June 27, 2016 23:00
Docker py put archive example
import tarfile
import time
from io import BytesIO
admin_password = 'xxxxx'
#write password to file
pw_tarstream = BytesIO()
pw_tar = tarfile.TarFile(fileobj=pw_tarstream, mode='w')
file_data = admin_password.encode('utf8')
@zbyte64
zbyte64 / admin.py
Created September 6, 2017 03:02
Django select2 example
from django.contrib import admin
from .models import Blog
from .fields import UserSelectWidget
class BlogForm(forms.ModelForm):
class Meta:
model = Blog
exclude = []
@zbyte64
zbyte64 / build_arm.sh
Created August 17, 2018 21:40
Compile Stepmania 5.2 on the RaspberryPi
#inside the Build directory of the source code:
cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=Release -DWITH_SSE=OFF -DWITH_CRASH_HANDLER=OFF -DWITH_MINIMAID=OFF ..
cmake ..
make -j2
@zbyte64
zbyte64 / events.py
Created November 1, 2020 18:33
Example: Django-Graphene subscriptions with graphene_subscriptions and django_lifecycle
from enum import Enum, auto
class NotificationEvents(Enum):
NEW_MESSAGE = auto()
UPDATE_MESSAGE = auto()
@zbyte64
zbyte64 / hdhr-listings-to-m3u.py
Last active December 6, 2020 00:34 — forked from caseyavila/hdhr-listings-to-m3u.py
Convert HDHomeRun Prime Listings to M3U Format
#!/usr/bin/env python
#
# this script will convert the hdhomerun listings (channels) to
# m3u format for use with external media players. before running
# this script, be sure to modify the <<config>> variable settings
# below.
#
# Suggested Usage: This script should be run on a cron to keep
# the channel lineup to date. Below is an example of how to execute this script:
# python /path/to/script/hdhomerun-prime-listings-to-m3u.py > /path/to/playlist.m3u