Skip to content

Instantly share code, notes, and snippets.

Avatar

Thijs Triemstra thijstriemstra

View GitHub Profile
@thijstriemstra
thijstriemstra / upload-server.py
Last active May 7, 2018
example upload Flask server
View upload-server.py
import os
from flask import Flask, flash, request, redirect, url_for, render_template, send_from_directory
from werkzeug import secure_filename
UPLOAD_FOLDER = 'uploads'
ALLOWED_EXTENSIONS = set(['webm', 'mp4', 'mp3', 'wav', 'jpeg', 'gif', 'png'])
static_folder = os.path.abspath(os.path.dirname(__file__))
template_dir = os.path.join(static_folder, 'examples')
@thijstriemstra
thijstriemstra / play.sh
Last active Oct 8, 2020
omxplayer USB audio
View play.sh
# Playback on USB audio device (the second soundcard's first device),
# with omxplayer:
#
# $ ./play.sh myfile.mp4
#
# Use 'aplay -l' to list available devices, e.g:
#
# $ aplay -l
# card 1: Device [USB Audio Device], device 0: USB Audio [USB Audio]
# Subdevices: 1/1
View gist:2a18f6300f7ce4ba02f62f066ca82201
runtime/cgo: pthread_create failed: Resource temporarily unavailable
SIGABRT: abort
PC=0x76dedf70 m=2 sigcode=4294967290
goroutine 0 [idle]:
goroutine 1 [chan receive, 437 minutes]:
main.btcdMain(0x0, 0x0, 0x0)
/home/rpitest/go/src/github.com/roasbeef/btcd/btcd.go:170 +0x6dc
main.main()
@thijstriemstra
thijstriemstra / bittrex_order_history.py
Created Aug 20, 2017
Parse fullOrders.csv downloaded from Bittrex account
View bittrex_order_history.py
"""
Parse fullOrders.csv downloaded from Bittrex account.
Requirements::
pip install dateparser
"""
import csv
@thijstriemstra
thijstriemstra / README.md
Last active Mar 9, 2020 — forked from savetheclocktower/README.md
Using a potentiometer as a volume control for the Raspberry Pi
View README.md
@thijstriemstra
thijstriemstra / async-pyqt-sevensegment.py
Last active Apr 10, 2018
pyqt async sevensegment example using quamash.QEventLoop and max7219
View async-pyqt-sevensegment.py
import sys
import time
import asyncio
from PyQt5.QtWidgets import (QApplication, QProgressBar, QMainWindow, QSlider,
QVBoxLayout, QWidget)
from quamash import QEventLoop, QThreadExecutor
import max7219.led as led
@thijstriemstra
thijstriemstra / pyqt_sevensegment_test.py
Last active Nov 22, 2016
time.sleep calls block pyqt app
View pyqt_sevensegment_test.py
#!/usr/bin/env python
"""
PyQt example for seven segment displays.
"""
import sys
import time
from PyQt5 import QtWidgets
View keybase.md

Keybase proof

I hereby claim:

  • I am thijstriemstra on github.
  • I am thijstriemstra (https://keybase.io/thijstriemstra) on keybase.
  • I have a public key whose fingerprint is 8C40 DF98 F750 A753 7AAF 5512 0516 CC19 A81B A379

To claim this, I am signing this object:

@thijstriemstra
thijstriemstra / build-extension.sh
Created Aug 2, 2016
Compile static C-extension with multiple source files for PyQt
View build-extension.sh
#!/bin/bash
set -e
set -o pipefail
source ../../settings.sh
export PATH=$PATH:$COMPILER_ROOT
export CC="${PLAT}gcc -pthread"
export AR="${PLAT}ar rcsv"
echo `${PLAT}gcc --version`
@thijstriemstra
thijstriemstra / config.diff
Created Jun 20, 2016
rpi toolchain config diff
View config.diff
< # Automatically generated make config: don't edit
< # crosstool-NG 1.15.2 Configuration
< # Tue Aug 7 15:36:12 2012
---
> # Automatically generated file; DO NOT EDIT.
> # Crosstool-NG Configuration
5a5
> CT_CONFIGURE_has_make381=y
7d6
< CT_CONFIGURE_has_svn=y
You can’t perform that action at this time.