Skip to content

Instantly share code, notes, and snippets.

View Twilight0's full-sized avatar
🏠
Working from home

Paradigm Shifter Twilight0

🏠
Working from home
View GitHub Profile
@Twilight0
Twilight0 / hot_reload.py
Last active July 4, 2022 13:35
Hot reload a python working script (compatible with both python 2 & 3)
#!/usr/bin/python
from __future__ import print_function
import sys, os, time, threading, subprocess, fnmatch
class SourceChangeMonitor(threading.Thread):
# Remember the process ID of the subprocess for when
# we want to restart it
_process = None
import kivy
kivy.require('1.10.0')
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.uix.textinput import TextInput
class LoginScreen(GridLayout):
@Twilight0
Twilight0 / encode.py
Created October 26, 2020 20:14 — forked from gasman/encode.py
Encoding a file as a Youtube video - https://www.youtube.com/watch?v=hyqLv2_zBdA
# Encode inputfile.tar.gz as a series of video frames
# Frames are written to frames/frameNNNN.png
from PIL import Image
with open('inputfile.tar.gz', 'rb') as f:
data = f.read()
WIDTH = 120
HEIGHT = 90
CHUNK_SIZE = int((WIDTH * HEIGHT) / 8)
@Twilight0
Twilight0 / keybase.md
Created September 16, 2018 14:50
keybase

Keybase proof

I hereby claim:

  • I am twilight0 on github.
  • I am thgiliwt (https://keybase.io/thgiliwt) on keybase.
  • I have a public key ASC6hE84Vs3u3heXuecX0NeI219M6zloCi-Ywp5UeFZshAo

To claim this, I am signing this object: