Skip to content

Instantly share code, notes, and snippets.

View CTXz's full-sized avatar

Patrick Pedersen CTXz

  • Technische Universität Berlin
  • Berlin
View GitHub Profile
@CTXz
CTXz / binom.py
Created January 29, 2019 19:46
Just a small python library that provdes binompdf and binomcdf in TI Nspire syntax
'''
Copyright (c) 2018 Patrick Pedersen <ctx.xda@gmail.com>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
echo "$(cat <<- 'EOF'
00000000: 504b 0304 1400 1608 0000 a173 b74e 6f61 PK.........s.Noa
00000010: ab2c 1400 0000 1400 0000 0800 0000 6d69 .,............mi
00000020: 6d65 7479 7065 6170 706c 6963 6174 696f metypeapplicatio
00000030: 6e2f 6570 7562 2b7a 6970 504b 0304 1400 n/epub+zipPK....
00000040: 1608 0800 8a73 b74e fdea 87dc 0f01 0000 .....s.N........
00000050: e501 0000 0700 0000 746f 632e 6e63 788d ........toc.ncx.
00000060: 91bf 6e83 400c 87f7 3cc5 e916 da01 8e7f ..n.@...<.......
00000070: 4993 e820 43e7 561d da07 3077 0e41 055f I.. C.V...0w.A._
00000080: 444c a07d fa42 9456 0c8d 94cd b6be df67 DL.}.B.V.......g
#!/usr/bin/env bash
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

Programming ATtiny chips with an Arduino

1. Flash the ArduinoISP firmware onto the programmer board (ex. Arduino UNO) 2. Connect the Arduino's SPI header to the ATtiny:

Arduino ATiny Digispark
5V VCC Vin
GND GND GND
MOSI PB0 P0

Getting Java to work with VS Code on Ubuntu has been a rather frustrating journey. Knowing how prone I am to forgetting things, and considering how likely it is that I'll have to configure VScode for java some time again, I figured it'd be good if I wrote down the few successful milestones to get VScode to do what I actually want it to fucking do.

Installing the Java development kit and Java runtime environment

Unless a newer or older version is explicitly required, I recommend sticking to ubuntu's default jdk and jre packages:

Preparation

Download this ESP8266 toolchain to ~/esp8266:

$ git clone https://github.com/gschorcht/RIOT-Xtensa-ESP8266-toolchain.git ~/esp8266

Install the required dependencies for ColorChord:

@CTXz
CTXz / FixSamples.py
Created July 30, 2022 00:37
This script saved my 5 hour long recording of DJ sets at an event, bless it!
# This script saved my 5 hour long recording of DJ sets at an event, bless it!
# The recording was likely flawed due to a sampling rate missmatch between the interface and
# the recording software. The result was a recording that had a faulty sample or two
# every 48 samples. The audible effect of this is that the recording had a high pitched
# "bit-cursh-ish" sound.
# To fix the recordings, the script applies a linear interpolation every 48 samples
# (where the faulty samples are). While a linear interpolation isn't the most accurate
# interpolation method to restore audio, it actually suffices for errors of so few samples.
@CTXz
CTXz / midi_notes.h
Last active February 6, 2024 17:59
C header that contains defines for all midi notes
/*
* Copyright (C) 2024 Patrick Pedersen
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of

Banana Pi M2 Zero Starter

Welcome to this little guide I made myself to quickly get stared with Banana Pi M2 Zero projects!

At the end of the guide you should have a headless Banana Pi M2 Zero set-up with wiringPi and RPi.GPIO support.

Special thanks to TuryRx's Banana Pi M2 Zero GPIO guide, as most steps to get GPIOs working here were directly taken from their extensive guide.

Headless Armbian Set-Up

@CTXz
CTXz / bpi-m2z-gpio-setup.sh
Last active January 23, 2024 02:22
An installation script that sets up GPIO functionality for the Banana Pi M2 Zero. It installs prerequired packages, necessary system files, a Banana Pi M2 Zero compatible port of WiringPi and a Banana Pi M2 Zero compatible port of RPi.GPIO.
#!/usr/bin/env bash
#
# Copyright (C) 2023 Patrick Pedersen
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#