A markdown friendly Raspberry PI Pinout table and list.
I used a mixture of Excel, Vim and Regex to make these.
Output from the PIs pinout command
| """ | |
| Simple Pandas demo | |
| - generating time-series data | |
| - writing & load with CSV | |
| - resampling | |
| """ | |
| # app/urls.py | |
| urlpatterns += [ | |
| path('<path:path>', views.view_static, name='serve') | |
| ] | |
| # app/views.py | |
| from django.views.static import serve | |
| def view_static(response, path): | |
| path = os.path.join('static', path) |
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <!-- Required meta tags --> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
| <!-- Bootstrap CSS --> | |
| <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous"> |
| APPNAME=My Sketchup Plugin | |
| DISTNAME=MyPlugin | |
| BUILDDIR = build | |
| DISTDIR = dist | |
| SRCDIR = src | |
| ENCRYPTOOL = /Applications/SketchupScrambler | |
| GIT_DIR = $(shell git rev-parse --show-toplevel) |
| """ | |
| Simple timer function decorator | |
| """ | |
| import time | |
| def timeme(func): | |
| def inner(*args, **kwargs): | |
| fname = func.func_name | |
| start = time.clock() |
| #!/usr/bin/env bash | |
| # Turn on one-wire support for rPi | |
| # https://learn.adafruit.com/adafruits-raspberry-pi-lesson-11-ds18b20-temperature-sensing/ds18b20 | |
| cat /sys/bus/w1/devices/28*/w1_slave |\ | |
| grep t= | awk -F't=' '{print $2}' | \ | |
| python3 -c 'import sys; sys.stdout.write( str( float(sys.stdin.read())/1000 ) )' |
| #!/usr/bin/env python | |
| # Prototyped with Barcode Scanner on Android and the "custom search" url | |
| # https://play.google.com/store/apps/details?id=com.google.zxing.client.android&hl=en_GB | |
| # | |
| # Routes: | |
| # http://[ip-address]:5001/ | |
| # http://[ip-address]:5001/add/[barcode] | |
| #!/bin/bash | |
| HEAD=$(git rev-parse --short HEAD) | |
| GIT_ROOT=$(git rev-parse --show-toplevel) | |
| DIRNAME=${GIT_ROOT##*/} | |
| NAME="${DIRNAME}_$HEAD.zip" | |
| 7z a -tzip $GIT_ROOT/../$NAME -w $GIT_ROOT/../$DIRNAME | |
| echo "Wrote $GIT_ROOT/../$NAME" |