Skip to content

Instantly share code, notes, and snippets.

View ktzar's full-sized avatar

Miguel Gonzalez ktzar

View GitHub Profile
@ktzar
ktzar / cheatsheet.md
Last active August 19, 2022 14:22
TMUX cheatsheet

Commands to open Tmux

# Start new session
tmux
# List sessions
tmux ls
# Attach to a session
tmux a -t sess_num
# Rename a session
@ktzar
ktzar / mp32opus.sh
Created July 13, 2017 14:52
Audio conversion tools
#!/bin/bash
BITRATE=64
OUTDIR="."
if [ "$1" != "" ]; then
BITRATE=$1
fi
if [ "$2" != "" ]; then
OUTDIR=$2
fi

From https://blog.thimbleweedpark.com/zero_bugs Don't underestimate the fans. I found quite a lot of them, I think. How many percents would you say those are? Those are present in most versions of the game:

  • The storekeeper closes the door AFTER he walks to the counter. (all versions except EGA)
  • The line "The basic theory is fine." of the Fettucini Brothers is skipped due to a script error.
  • Smirk's cigar's smoke positioning is off.
  • Guybrush occasionally refuses to burn the cereals, even after the journey to Monkey Island and vice versa. It is possible to get stuck here if you didn't bring anything else to burn.
  • The Piranha poodles freeze briefly before eating the meat.
  • Ghost key cloning by repeatedly using the compass on it while in Lechuck's room.
  • Storekeeper walks through mid-air when shortening the first open safe cutscene early.
@ktzar
ktzar / index.html
Created November 9, 2016 10:28
Test using anchor tag to parse URL
<style>
body {
font-size: 90px;
text-align: center;
color: white;
}
</style>
<div id="result"></div>
<script>
window.onload = function () {
@ktzar
ktzar / index.md
Created May 30, 2016 20:18
Why Most Unit Testing is Waste

Why Most Unit Testing is Waste

By James O Coplien from http://rbcs-us.com/documents/Why-Most-Unit-Testing-is-Waste.pdf

1.1 Into Modern Times

Unit testing was a staple of the FORTRAN days, when a function was a function and was sometimes worthy of functional testing. Computers computed, and functions and procedures represented units of computation. In those days the dominant design process composed complex external functionality from smaller chunks, which in turn orchestrated yet smaller chunks, and so on down to the level of well-understood primitives. Each layer supported the layers above it. You actually stood a good chance that you could trace the functionality of the things at the bottom, called functions and procedures, to the requirements that gave rise to them out at the human interface. There was hope that a good designer could understand a given function’s business purpose. And it was possible, at least in well-structured code, to reason about the calling tree. You could mentally simulate

@ktzar
ktzar / gist:3773388
Created September 23, 2012 23:09
Reading from a light sensor
int sensorValue = 0;
int outputValue = 0;
int previousValue = 0;
const int threshold = 30;
const int analogInPin = A0;
void setup() {
// initialise serial:
Serial.begin(9600);
}
@ktzar
ktzar / gist:3773385
Created September 23, 2012 23:08
Changing your screen's brightness from the data in a serial port
import serial, time, os
ser = serial.Serial('/dev/ttyACM0', 9600)
while 1:
time.sleep(0.05)
try:
line = ser.readline().strip()
value = int(line) * 10
command = 'echo "{0}" > /sys/class/backlight/intel_backlight/brightness'.format(value)
os.system(command)
print(command)