This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from threading import Event, Thread | |
import bpy | |
from inotify_simple import INotify, flags | |
import traceback | |
# this is still buggy on properly cleaning things up on exit | |
def run(exit: Event, changed: Event, filename): | |
inotify = INotify() | |
inotify.add_watch(filename, flags.MODIFY) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
trap 'kill $(jobs -pr) 2>/dev/null' SIGINT SIGTERM EXIT | |
browser=chromium-browser | |
python3 -m http.server & | |
$browser "http://localhost:8000/$1" 2>/dev/null & | |
browserpid=$! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// clang -g -O2 -I/usr/include/ffmpeg -lavformat -lavutil -lavcodec avformat_example.c -o avformat_example | |
#include <assert.h> | |
#include <libavcodec/avcodec.h> | |
#include <libavformat/avformat.h> | |
#include <libavutil/file.h> | |
int main(int argc, char *argv[]) { | |
if (argc != 2) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools | |
import numpy as np | |
from PIL import Image | |
from operator import itemgetter | |
from collections import defaultdict | |
import base64 | |
import io | |
dirs_map = { | |
(1, 0) : 'R', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
python reimplementation of http://schepers.cc/getting-to-the-point (source http://schepers.cc/svg/path/catmullrom2bezier.js) | |
Pretty much the coolest thing ever | |
""" | |
from collections import namedtuple | |
import numpy as np | |
Point = namedtuple('Point', ('x', 'y')) | |
def catmull_rom_to_bezier(points): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# generic migration template | |
from playhouse.migrate import * | |
from models import * | |
migrator = SchemaMigrator.from_database(database) | |
def add_column(field): | |
return migrator.add_column(field.model._meta.table_name, field.column_name, field) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import multiprocessing | |
from subprocess import run, PIPE | |
import os | |
import gc | |
def worker(x): | |
return x * x | |
def n_files_open(): | |
return len(files_open()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Avoid Slack Redirect | |
// @namespace slackrediravoid | |
// @include https://*.slack.com/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
let si = window.setInterval(clearanchors, 2000); | |
function clearanchors(){ | |
let anchors = document.querySelectorAll('a[href^="https://slack-redir"]'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
import io | |
import csv | |
from functools import partial | |
s3c = boto3.client('s3') | |
def logging_read(read, amt): | |
print('READ {}'.format(amt)) | |
return read(amt) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param( | |
[parameter(mandatory=$true)] | |
[string]$infile, | |
[parameter(mandatory=$true)] | |
[string]$outfile | |
) | |
# https://msdn.microsoft.com/en-us/vba/excel-vba/articles/workbook-saveas-method-excel |