Skip to content

Instantly share code, notes, and snippets.

View minerscale's full-sized avatar

Aaron Cottle minerscale

  • Australia
View GitHub Profile
@minerscale
minerscale / diff.patch
Last active January 17, 2024 10:49
kdockwidgets 2.0 patch required for building hotspot on arch
diff -bur --new-file src/hotspot-v1.4.1/src/dockwidgetsetup.cpp hotspot-v1.4.1-orig/src/dockwidgetsetup.cpp
--- src/hotspot-v1.4.1/src/dockwidgetsetup.cpp 2022-12-21 21:55:40.000000000 +1100
+++ hotspot-v1.4.1-orig/src/dockwidgetsetup.cpp 2024-01-17 21:46:21.320639401 +1100
@@ -8,15 +8,22 @@
#include "dockwidgetsetup.h"
#include <kddockwidgets/Config.h>
-#include <kddockwidgets/FrameworkWidgetFactory.h>
+#include <kddockwidgets/kddockwidgets_version.h>
+
#include <math.h>
#include <stdio.h>
#define BITRATE 16000.0
#define TAU 6.2831853
#define R -127
double sqr(int i){
return (i%2)?1.0/i:0;
}
@minerscale
minerscale / lightSensor.ino
Created March 28, 2018 07:34
Arduino light sensor code.
// The Threshold for turning on the light between 0 and 1024
// 0 means the light is always off and 1024 means it's always on.
// 900 seems to be a good value.
#define THRESHOLD 900
// Digital pins:
#define RED_PIN 9
#define GREEN_PIN 10
#define BLUE_PIN 11
@minerscale
minerscale / Solution.py
Created July 28, 2017 10:50
Solution to a problem
def findVicinals(words):
word = words.lower()
VicinalLetters = []
for i in word:
test = (ord(i)+59)%26
for j in word:
othertest = (ord(j)+59)%26
if ((test + 1)%26 == othertest or (test - 1)%26 == othertest):
VicinalLetters.append(test)
break
@minerscale
minerscale / readWriteHotline.sh
Created July 20, 2017 10:38
Reading Writing Hotline
#!/usr/bin/env bash
beep -f261.6255653005986 -l300 -D 150.0 -n -f293.6647679174076 -l300 -D 150.0 -n -f293.6647679174076 -l150.0 -D 75.0 -n -f261.6255653005986 -l300 -D 150.0 -n -f329.6275569128699 -l450.0 -D 225.0 -n -f391.99543598174927 -l300 -D 150.0 -n -f391.99543598174927 -l150.0 -D 75.0 -n -f440.0 -l450.0 -D 225.0 -n -f329.6275569128699 -l800 -D 400.0 -n -f293.6647679174076 -l150.0 -D 75.0 -n -f261.6255653005986 -l150.0 -D 75.0