Skip to content

Instantly share code, notes, and snippets.

View isaacisnotjonah's full-sized avatar

isaacisnotjonah

View GitHub Profile
@gasman
gasman / encode.py
Created October 25, 2020 12:23
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)
@darencard
darencard / auto_git_file.md
Last active May 1, 2024 23:18
Automatic file git commit/push upon change

Please see the most up-to-date version of this protocol on my blog at https://darencard.net/blog/.

Automatically push an updated file whenever it is changed

Linux

  1. Make sure inotify-tools is installed (https://github.com/rvoicilas/inotify-tools)
  2. Configure git as usual
  3. Clone the git repository of interest from github and, if necessary, add file you want to monitor
  4. Allow username/password to be cached so you aren't asked everytime
@aphexddb
aphexddb / .wakeup
Last active May 14, 2023 05:10
OSX sleepwatcher script to take a photo on wakeup and upload to dropbox
#!/bin/bash
#
# Mac camera auto upload script
#
#####################################################
# Generate filename based on date stamp
FILE_SRC=/tmp/$(date +%m%d%y%H%M%S).jpg;
DROPBOX_FOLDER=macbook
DROPBOX_UPLOADER=/Users/<username>/Dropbox-Uploader/dropbox_uploader.sh