Skip to content

Instantly share code, notes, and snippets.

View fxadecimal's full-sized avatar
👨‍💻

fxadecimal

👨‍💻
View GitHub Profile
@fxadecimal
fxadecimal / raspberrypi-pinout.md
Last active January 10, 2026 07:39
Markdown Raspberry PI Pinout table and list.

Raspberry Pi Markdown Text

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
"""
@fxadecimal
fxadecimal / django-serve-spa.py
Created July 20, 2020 17:38
Quick workaround for serving static HTML / SPA from django in development
# 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)
@fxadecimal
fxadecimal / bootstap_4.1.html
Created October 3, 2018 12:24
Bootstrap 4.1 Hello World CDN and Navbar
<!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">
@fxadecimal
fxadecimal / Sketchup-Makefile
Last active March 1, 2017 14:29
Makefile for Sketchup Plugins (osx). Assumes your code directory is under src/
APPNAME=My Sketchup Plugin
DISTNAME=MyPlugin
BUILDDIR = build
DISTDIR = dist
SRCDIR = src
ENCRYPTOOL = /Applications/SketchupScrambler
GIT_DIR = $(shell git rev-parse --show-toplevel)
@fxadecimal
fxadecimal / timeme.py
Created April 28, 2016 12:24
Python timer function decorator
"""
Simple timer function decorator
"""
import time
def timeme(func):
def inner(*args, **kwargs):
fname = func.func_name
start = time.clock()
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fxadecimal
fxadecimal / temperature.sh
Last active October 24, 2015 11:36
ds18b20 simple temperature reader
#!/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 ) )'
@fxadecimal
fxadecimal / barcode_server.py
Created July 20, 2015 12:38
Simple prototype of a Barcode reader server using Flask.
#!/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]
@fxadecimal
fxadecimal / git_backup.sh
Last active September 30, 2025 14:17
Git ZIP Backup
#!/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"