Skip to content

Instantly share code, notes, and snippets.

I'm a broken fence in the yard of annoyance.

whitequark whitequark

I'm a broken fence in the yard of annoyance.
Block or report user

Report or block whitequark

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View _delay_4c.asm
lcall _delay_4c
sjmp .
; (ljmp delay_4c) ; 0c > 4c
mov acc, dph ; 3c
cjne a, #0, 00000$ ; 4c > 11c [A]
mov acc, dpl ; 3c
subb a, #(24/4+1) ; 2c
inc a ; 1c
whitequark / glasgow-applet-taxonomy.txt
Created Mar 3, 2019
See files in subdirectories of for details, including specific examples and counterexamples.
View glasgow-applet-taxonomy.txt
The ``interface`` taxon is the most fundamental and generic applet taxon. It groups applets
implementing interfaces that are used for purposes that do not fit into any single other taxon.
Because the ``interface`` taxon is so important, the applet names in this taxon are not prefixed
with the taxon name.
The ``memory`` taxon groups applets implementing interfaces to memory technology devices (volatile
and non-volatile) that include no functionality beyond manipulating data.
View gist:0451b9f1848c24fcfae383df12136ed2
# Macronix 25L6473E
$ glasgow run spi-flash-25c -V 3.3 --pin-ss 0 --pin-miso 1 --pin-mosi 2 --pin-sck 3 --pin-hold 4 identify
I: glasgow.device.hardware: device already has bitstream ID fd8d97b20930df7f44ace0a704c715e6
I: glasgow.cli: running handler for applet 'spi-flash-25c'
I: glasgow.applet.spi_flash_25c: port(s) A, B voltage set to 3.3 V
I: glasgow.applet.spi_flash_25c: JEDEC manufacturer 0xc2 (Macronix) device 0x2017
I: glasgow.applet.spi_flash_25c: device has valid SFDP 1.0 (JESD216) descriptor
I: glasgow.applet.spi_flash_25c: SFDP table #0: JEDEC, Flash Parameter Table 1.0 (JESD216)
I: glasgow.applet.spi_flash_25c: density (Mbits) : 64
I: glasgow.applet.spi_flash_25c: density (Mbytes) : 8
whitequark / gist:c316e23d9b8a7f1fa29d01cf452112a5
Last active May 11, 2018
View gist:c316e23d9b8a7f1fa29d01cf452112a5
ОКП 6349580385
whitequark / glinfo.c
Last active Mar 25, 2018
gcc -lGL -lX11 glinfo.c -o glinfo && ./glinfo
View glinfo.c
#include <GL/gl.h>
#include <GL/glx.h>
#include <stdio.h>
int main(int argc, char *argv[])
Display *dpy = XOpenDisplay(NULL);
if(!dpy) {
puts("cannot XOpenDisplay");
return 1;
whitequark / README.txt
Last active Feb 2, 2018
Strava archiver
View README.txt
1. install postgres
2. run makedb.rb >tiles.csv
3. run tiles.sql
4. run archive.rb
5. enjoy
whitequark / chrome-export-bookmark-folder.js
Last active Jun 23, 2017
A small bookmarklet to export a bookmark folder as HTML, since Chrome does not provide this functionality
View chrome-export-bookmark-folder.js
// by whitequark. released under CC0.
(function() {
function downloadFile(fileName, content) {
var dataURI = 'data:text/plain;charset=UTF-8,' +
var fakeLink = document.createElement('a');
fakeLink.setAttribute('href', dataURI);
fakeLink.setAttribute('download', fileName);
whitequark / subrenamer.rb
Last active Jun 14, 2017
Automated subtitle file renamer
View subrenamer.rb
#!/usr/bin/env ruby
# License: BSD-0-clause
VIDEO_EXTS = %w(.mkv .avi .mp4)
SUBTITLE_EXTS = %w(.ssa .ass .srt)
if ARGV.empty?
puts "Automatic subtitle file renamer by"
puts "Usage: #{$0} *.ssa *.mkv"
puts " or: DRY_RUN=1 #{$0} *.ssa *.mkv"
whitequark / blink.v
Last active Feb 24, 2017
iCE40HX8K-B-EVM Yosys example
View blink.v
whitequark / ur jtag is shite.patch
Last active Sep 26, 2016
PKG_CONFIG_PATH=~/Work/mxe/usr/x86_64-w64-mingw32.static/lib/pkgconfig ../configure --host=x86_64-w64-mingw32 --disable-shared --disable-python --enable-cable=ft2232 --enable-bus=fjmem --disable-bsdl
View ur jtag is shite.patch
diff --git a/urjtag/src/bfin/bfin.c b/urjtag/src/bfin/bfin.c
index 8205a1e..4bb688a 100644
--- a/urjtag/src/bfin/bfin.c
+++ b/urjtag/src/bfin/bfin.c
@@ -197,7 +197,7 @@ bfin_dbgstat_value (urj_part_t *part)
else \
return 0; \
You can’t perform that action at this time.