Skip to content

Instantly share code, notes, and snippets.

View DDR0's full-sized avatar
🦇
Making Stuff

David Roberts DDR0

🦇
Making Stuff
View GitHub Profile
@DDR0
DDR0 / Qt Dbus Error Emitting Issue.md
Last active February 16, 2019 05:17
I believe the PyQt5 documentation is in error. This is why:
@DDR0
DDR0 / watch-computer.sh
Created January 26, 2019 09:33
horrible bash scripting
#!/bin/bash
set -uo pipefail
IFS=$'\n'
trap "exit;" SIGINT SIGTERM #The following loop works fine in Konsole but won't ever stop on Gnome Terminal.
while true; do
find -regex '\./[^_\.].*' ! -name git_description ! -path 'util/stats_reported' | entr -d bash -c "
if [[ \$(cat git_description) != \$(git describe --tags --always) ]]; then #Only update when description changes, results in some thrashing otherwise.
git describe --tags --always > git_description
@DDR0
DDR0 / c256_shell.py
Last active September 23, 2018 21:12
Commodore 256 Serial Shell
#!/usr/bin/python3
import sys, cmd, ast, pathlib
try:
import serial
except ModuleNotFoundError:
print('Could not import pyserial library. Try running "pip3 install pyserial".')
sys.exit(1)
debug = False #Throw error on exceptions if True, otherwise, keep running and keep command history.
/*
//WPPLS
ccMatrix[0] = 1.7701; ccMatrix[1] = -0.3927; ccMatrix[2] = -0.1725;
ccMatrix[3] = -0.3323; ccMatrix[4] = 1.4063; ccMatrix[5] = -0.1257;
ccMatrix[6] = -0.1747; ccMatrix[7] = 0.2080; ccMatrix[8] = 0.8756;
//LS
ccMatrix[0] = 1.7356; ccMatrix[1] = -0.3398; ccMatrix[2] = -0.1910;
ccMatrix[3] = -0.3422; ccMatrix[4] = 1.4605; ccMatrix[5] = -0.1701;
ccMatrix[6] = -0.1165; ccMatrix[7] = -0.0475; ccMatrix[8] = 1.0728;
elisa issues 2018-01-19
by DDR following the tutorial
- Minor complaint: titlescreen.cfg crashed when reloading elisa, despite --edit-and-continue - there were some objects asserting level.player is obj frogatto_playable.
- resolution is extremely low by default on my 4k monitor, and the game is not resizeable - even in the editor. It should be resizeable in the editor, at least to allow for the editor controls.
- editor object mouseover description text, in the object picker, often runs off screen. It should soft-wrap.
- setting background to air-stage1 crashed despite --edit-and-continue
- font size in the editor doesn't persist - quite annoying on a high-res monitor
- When code-editing an object, @instance should not be the default to pop up. The object's .cfg file code should be, because that's usually what we want to edit – at least in the Elisa tutorial.
- Whatever magic behind "What's really nice about this interface is that I can just click [on the first frame of the walk animation, third from
@DDR0
DDR0 / Feld0 on Mario through the ages.txt
Created January 11, 2018 07:25
A short piece of copypasta about Mario games.
[11:01 PM] Feld0:
I haven't gotten to the end of Super Mario Odyssey yet but I've been spoiled with Yoshi's appearance
I don't like it, no
I want another game to come out that, like Super Mario World, allows Mario to take Yoshi with him for the entire adventure. Not the bullcrap of containing him to specific levels.
Or have Yoshi be a first-rate playable character in his own right like in Super Mario 64 DS
Containing him to specific levels relegates him to a puzzle-solving gimmick. Making him a main character for the entire adventure makes him, well, a character with personality and history.
Not that Mario was ever really about complex storytelling but there has historically been enough there to let your imagination run wild about why Mario does what he does
Fantasizing about why Bowser keeps kidnapping Peach and why Mario will put up with absolutely anything to get her back helps add some motivation to the whole thing
Super Mario Galaxy nailed this IMO by giving Rosalina an elaborate backstory and presentin
@DDR0
DDR0 / notes of the unterzee.txt
Created November 6, 2017 15:04
Sunless Sea notes
notes of the unterzee
Things:
- solacefruit usually grows far to the north of the uddershroom
- dark-spectacled admiral
- buys moves in the great game for e30, 1 favour
Places:
u1 fallen london
u2 hunter's keep
javascript:(function(){const%20filterHolder%20%3D%20document.createElement(%27div%27)%3BfilterHolder.innerHTML%20%3D%20%60%3Csvg%20color-interpolation-filters%3D%22sRGB%22%3E%3Cdefs%3E%3Cfilter%20id%3D%22pixelate%22%20x%3D%220%25%22%20y%3D%220%25%22%20width%3D%22100%25%22%20height%3D%22100%25%22%3E%3C!--Thanks%20to%20Zoltan%20Fegyver%20for%20figuring%20out%20pixelation%20and%20producing%20the%20awesome%20pixelation%20map.%20--%3E%3CfeGaussianBlur%20stdDeviation%3D%222%22%20in%3D%22SourceGraphic%22%20result%3D%22smoothed%22%3E%3C%2FfeGaussianBlur%3E%3CfeImage%20xlink%3Ahref%3D%22data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAIAAAACDbGyAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAA1SURBVBhXDccxAQAADMKwSkUCEpCABKRu%2BcJGR4aHBistKS7qPzQkOCh%2FUxNjI%2F9FRYSFxAEwbBkB3dsQzwAAAABJRU5ErkJggg%3D%3D%22%20result%3D%22displacement-map%22%20width%3D%225%22%20height%3D%225%22%3E%3C%2FfeImage%3E%3CfeTile%20in%3D%22displacement-map%22%20result%3D%22pixelate-map%22%3E%3C%2FfeTile%3E%3C
@DDR0
DDR0 / log.txt
Created September 23, 2017 21:32
$ npm cache clean --force
npm WARN using --force I sure hope you know what you are doing.
0 in ~/html/emotebuilder git:(master)
$ npm cache clean -g --force
npm WARN using --force I sure hope you know what you are doing.
0 in ~/html/emotebuilder git:(master)
$ rm node_modules -rf
0 in ~/html/emotebuilder git:(master)
$ npm install
npm WARN deprecated typings@1.3.1: Typings is deprecated in favor of NPM @types -- see README for more information
#!/bin/bash
#Fix babel compilation error; --plugins transform-class-properties likes to make global functions which overwrite each other if you have two files with class properties.
#This should be fixed by using webpack. See https://github.com/markerikson/react-redux-links/blob/master/webpack-tutorials.md
set -eu
set -o pipefail
MODULENAME=$(echo $1 | perl -lne 's/([^\/]*?)\.// or next; s/\s.*//; print $1') #extract the filename from the path
perl -pi.bak -e "s|_initialiseProps|_initialiseProps_in_${MODULENAME//-/_}|g" $1 && rm $1.bak #rename all occurences of _initialiseProps, appending _in_«file_name»