Skip to content

Instantly share code, notes, and snippets.

View timotree3's full-sized avatar

Timo Carlin-Burns timotree3

View GitHub Profile
@timotree3
timotree3 / queue.js
Created February 2, 2022 00:01
JS Queue
export default class Queue {
constructor() {
// All fields should be private
this.waker = null
this.kill = false
this.items = []
this.killed = this.attend()
}
async enqueue_and_wait(async_fn) {
@timotree3
timotree3 / http-url-handler.desktop
Created April 22, 2021 00:07
Hanabi URL Handler
[Desktop Entry]
Name=HTTP URL handler
Comment=Open an HTTP/HTTPS URL with a particular browser
TryExec=http_url_handler.py
Exec=http_url_handler.py %u
X-MultipleArgs=false
Type=Application
Terminal=false
NoDisplay=true
MimeType=x-scheme-handler/http;x-scheme-handler/https
@timotree3
timotree3 / Minecraft.desktop
Last active June 9, 2020 20:10
Minecraft Launcher 1.6 Application Files
[Desktop Entry]
Name=Minecraft
Comment=Minecraft - Java Edition
Exec=java -jar /home/timo/.minecraft/launcher.jar
Icon=minecraft
Terminal=false
Type=Application
Categories=Game
@timotree3
timotree3 / log.txt
Created September 9, 2019 16:39
Circle CI Log
This file has been truncated, but you can view the full file.
#!/bin/bash -eo pipefail
nix-shell --run hc-app-spec-test
building '/nix/store/sqll2fajnq18cjxcjnxf1bgyrjlspn4i-rust-1.38.0-nightly-2019-07-13-69656fa4c.drv'...
/nix/store/zysdrla13l09k7xjya6kqgvz7rg8xza1-rust-std/lib/rustlib:
uninstall.sh: /nix/store/fmlyxb53asc095aqzzq692wwvnkqvka7-rust/lib/rustlib/uninstall.sh
rust-installer-version: /nix/store/fmlyxb53asc095aqzzq692wwvnkqvka7-rust/lib/rustlib/rust-installer-version
install.log: /nix/store/fmlyxb53asc095aqzzq692wwvnkqvka7-rust/lib/rustlib/install.log
components: /nix/store/fmlyxb53asc095aqzzq692wwvnkqvka7-rust/lib/rustlib/components
/nix/store/cz6hwlg8vn8jbll16fwagnfzwchpl3cw-rust-std/lib/rustlib/x86_64-unknown-linux-gnu/lib:
@timotree3
timotree3 / rotation.js
Created July 7, 2017 15:21
Coordinate Transformation
/*****************************************
* credit to *
* http://www.solitaryroad.com/c308.html *
*****************************************/
function Location(x, y) {
this.x = x;
this.y = y;
this.flip_h = function(max) {
return new Location(max - this.x, this.y);
};
@timotree3
timotree3 / pre-commit
Last active March 19, 2017 03:38
My holochain githooks (put in .git/hooks)
#!/bin/bash
if [ -n "$(gofmt -s -l .)" ]; then
echo "\`gofmt -s -w .\` your code."
exit 1
fi
@timotree3
timotree3 / crash.py
Created February 12, 2016 18:16
Crash python
infilist=["I AM CRASH"]
message='Crashing... Please wait.'
def crash():
global message
global infilist
templist = []
for element in infilist:
templist.append(element)
infilist.append(templist)
print(message)
@timotree3
timotree3 / ansi.py
Created February 12, 2016 17:12
Display ANSI formatting
print('\033[1;37m This is normal')
print("")
for attr in range(0,8):
for fg in range(30,38):
print('')
print('\033[1;37m default ',end="")
for bg in range(40,48):
print('\033['+ str(attr) +';'+ str(bg) +';'+ str(fg) +'m ' \
+str(attr)+';'+str(fg)+';'+str(bg)+'\033[m ',end="")
print("")
@timotree3
timotree3 / pydiff.py
Created February 12, 2016 17:10
Keep differences
def keepDiff(new,old=None):
result = []
if(not(old) or old==new):
return new
else:
try:
for i in range(0,len(new)):
try:
if(old[i]==new[i]):
result.append(None)