Skip to content

Instantly share code, notes, and snippets.

I was drawn to programming, science, technology and science fiction
ever since I was a little kid. I can't say it's because I wanted to
make the world a better place. Not really. I was simply drawn to it
because I was drawn to it. Writing programs was fun. Figuring out how
nature works was fascinating. Science fiction felt like a grand
adventure.
Then I started a software company and poured every ounce of energy
into it. It failed. That hurt, but that part is ok. I made a lot of
mistakes and learned from them. This experience made me much, much
@andy-thomason
andy-thomason / Genomics_A_Programmers_Guide.md
Created May 14, 2019 13:32
Genomics a programmers introduction

Genomics - A programmer's guide.

Andy Thomason is a Senior Programmer at Genomics PLC. He has been witing graphics systems, games and compilers since the '70s and specialises in code performance.

https://www.genomicsplc.com

@alphapapa
alphapapa / fitness.org
Last active July 6, 2024 16:48
An Emacs food/weight/workout tracker self-contained in a single Org file

Plots

/home/me/org/double-plot.png

Tasks

@bretton
bretton / forex-scrape.md
Last active March 19, 2024 19:36
Scraping Forex Data

Scraping Forex Data

I was looking for ways to scrape forex data after fixer.io switched to a subscription model with rate-limiting, making their API useless for lots of queries.

1. Use an alternative API

One alternative API which is still free is https://exchangeratesapi.io/

It's basically a drop-in replacement for fixer.io and can be used to get all forex rates in json format at

@dylanmckay
dylanmckay / facebook-contact-info-summary.rb
Last active March 12, 2024 22:46
A Ruby script for collecting phone record statistics from a Facebook user data dump
#! /usr/bin/env ruby
# NOTE: Requires Ruby 2.1 or greater.
# This script can be used to parse and dump the information from
# the 'html/contact_info.htm' file in a Facebook user data ZIP download.
#
# It prints all cell phone call + SMS message + MMS records, plus a summary of each.
#
# It also dumps all of the records into CSV files inside a 'CSV' folder, that is created
@neeasade
neeasade / elisp
Created March 19, 2018 12:19
org-pomoro music hook and display workflow
#!/bin/sh
result="$(emacsclient --eval "(progn $@)")"
if [ "$result" = "nil" ] || [ -z "$result" ]; then
exit 1
else
echo "$result"
exit 0
fi
@davidjgonzalez
davidjgonzalez / config.json
Created February 11, 2018 20:16
QNAP Homebridge Container config.json
{
"bridge": {
"name": "Homebridge",
"username": "CC:22:3D:E3:CE:30",
"port": 51826,
"pin": "123-45-678"
},
"description": "This file configures support for Nest, TP-Link Devices and HarmonyHub Remote.",
"platforms": [
{
@davidjgonzalez
davidjgonzalez / install.sh
Last active August 14, 2022 19:53
QNAP Homebridge Container install.sh
#!/bin/bash
# *** Copy this file to /root/.homebridge ***
# This file gets executed as root, so you can use it to
# install or update any plugin dependencies.
# See https://github.com/marcoraddatz/homebridge-docker#installsh
npm update -g n
@epologee
epologee / Binary STL parser.swift
Last active August 17, 2023 14:44
Create SceneKit geometry from Binary STL files in Swift 4
import Foundation
import SceneKit
public enum BinarySTLParser {
public enum STLError: Error {
case fileTooSmall(size: Int)
case unexpectedFileSize(expected: Int, actual: Int)
case triangleCountMismatch(diff: Int)
}
@agentsim
agentsim / highsierra_bootable.sh
Created June 10, 2017 02:23
Create bootable ISO from HighSierra Installer
# Generate a BaseSystem.dmg with 10.13 Install Packages
hdiutil attach /Applications/Install\ macOS\ 10.13\ Beta.app/Contents/SharedSupport/InstallESD.dmg -noverify -mountpoint /Volumes/highsierra
hdiutil create -o /tmp/HighSierraBase.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/HighSierraBase.cdr.dmg -noverify -mountpoint /Volumes/install_build
asr restore -source /Applications/Install\ macOS\ 10.13\ Beta.app/Contents/SharedSupport/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
cp -R /Volumes/highsierra/Packages /Volumes/OS\ X\ Base\ System/System/Installation
hdiutil detach /Volumes/OS\ X\ Base\ System/
hdiutil detach /Volumes/highsierra/
mv /tmp/HighSierraBase.cdr.dmg /tmp/BaseSystem.dmg