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
@whitequark
whitequark / README.txt
Last active Jan 11, 2020
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
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,' +
encodeURIComponent(content);
var fakeLink = document.createElement('a');
fakeLink.setAttribute('href', dataURI);
fakeLink.setAttribute('download', fileName);
@whitequark
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 whitequark@whitequark.org"
puts "Usage: #{$0} *.ssa *.mkv"
puts " or: DRY_RUN=1 #{$0} *.ssa *.mkv"
@whitequark
whitequark / blink.v
Last active Feb 24, 2017
iCE40HX8K-B-EVM Yosys example
View blink.v
@whitequark
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; \
}
-
+
View schema.sql
DROP TABLE IF EXISTS irclog;
CREATE TABLE irclog (
id SERIAL,
channel VARCHAR(30),
nick VARCHAR(40),
opcode VARCHAR(20),
timestamp INT,
line TEXT,
oper_nick VARCHAR(40),
payload TEXT,
View crashwrapper.sh
#!/bin/sh
reset() {
ssh lab.m-labs.hk './miniconda/bin/artiq_flash -m qc1 start'; sleep 1s
}
ping -w 30 -i 0.5 -c 2 kc705.lab.m-labs.hk
timeout 30s artiq_run -vv $1 2>&1 | tee /tmp/artiq_run$$
if grep KERNEL_FINISHED /tmp/artiq_run$$; then
exit 0 # no crash
@whitequark
whitequark / .xsession
Last active May 8, 2020
.xsession that starts up a minimal plasma-less KDE 5 environment with i3wm
View .xsession
#!/bin/sh
truncate -s0 ${HOME}/.xsession-errors
configDir=${HOME}/.config
mkdir -p $configDir
cat >$configDir/startupconfigkeys <<EOF
kcminputrc Mouse cursorTheme 'breeze_cursors'
kcminputrc Mouse cursorSize ''
@whitequark
whitequark / binutils-2.25.1-or1k-R_PCREL-pcrel_offset.patch
Last active Aug 29, 2015
libbfd patch to correctly apply data relocations in .eh_frame and .gcc_except_table sections
View binutils-2.25.1-or1k-R_PCREL-pcrel_offset.patch
--- a/bfd/elf32-or1k.c 2015-08-02 15:45:34.275922535 +0300
+++ b/bfd/elf32-or1k.c 2015-08-02 15:45:36.635931622 +0300
@@ -199,7 +199,7 @@
FALSE, /* partial_inplace */
0, /* src_mask */
0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
HOWTO (R_OR1K_16_PCREL,
You can’t perform that action at this time.