Skip to content

Instantly share code, notes, and snippets.

View k-yle's full-sized avatar
💙

Kyℓe Hensel k-yle

💙
View GitHub Profile
@k-yle
k-yle / qlab-camera-preset.scpt
Last active December 22, 2022 22:04
for use in a QLab script command
-- recall camera preset 0. Kyle, 21 August 2022
set theUrl to "http://admin:[email protected]/vb.htm?loadpreset=0"
do shell script "curl --connect-timeout 1 " & theUrl's quoted form
@k-yle
k-yle / typed-getter.ts
Last active April 8, 2020 00:29
💙 returns a different type depending on the value of a function's argument
type Users = any;
type Timetables = any;
type AllTheTypes =
| { name: 'users'; type: Users }
| { name: 'timetables'; type: Timetables }
type GetType<A, T> = A extends { name: T } ? A : never
@k-yle
k-yle / SAMBA.markdown
Last active February 8, 2024 02:46
💻 How to get out of SAMBA mode on NXT

How to get out of SAMBA mode

(SAMBA = SAM Boot Assistant)

  • In device manager the brick had a device description Bossa Program Port. It should be LEGO MINDSTORMS NXT.
  • Uninstalling the driver and reinstalling it still shows Bossa Program Port.
  • So I found the hardware ID of the Bossa Program Port from device manager (USB\VID_03EB&PID_6124).
  • Then I went to the c:\Windows\inf directory and searched for that ID.
  • That ID appeared in two INF files oem11.inf and oem42.inf.
  • oem11.inf has the device description "LEGO MINDSTORMS NXT Firmware Update Mode" and oem42.inf has the description "Bossa Program Port".
  • So that's why it installed the wrong driver.
@k-yle
k-yle / time.js
Last active June 8, 2016 04:32
🕒 get the true time in any timezone
const Time = UTCoffset => {
var d = new Date(),
utc = d.getTime() + (d.getTimezoneOffset() * 60000),
n = new Date(utc + (3600000 * UTCoffset)),
f = n.toLocaleString().toString().split(', '),
e = f[0].split('/');
if (Number(e[0]) < 10)
e[0] = 0 + e[0];
if (Number(e[1]) < 10)
e[1] = 0 + e[1];