This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I place this in the public domain | |
// Compile with | |
// <gcc/clang> <thisfile>.c -lOpenCL-Wall -Wextra -Wpedantic -std=c99 | |
// Created a long time ago | |
// Updated, some memory leaks fixed and so on 2014-05-28 | |
// Changed to real C instead of some quirky C++ casts inbetween (2014-05-28) | |
#include <CL/cl.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I place this in the public domain | |
def make_pdf_from_elements(elements, title, author): | |
# elements is a list containing flowables, while title and author are simply strings added to PDF metadata | |
def drawPage(canvas, doc): | |
canvas.setTitle(title) | |
canvas.setSubject(title) | |
canvas.setAuthor(author) | |
canvas.setCreator(author) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I place this in the public domain | |
# This only handles non-nested lists, emphasis, headings and horizontal rules (which are converted to page breaks) | |
# Sufficient for converting Markdown generated HTML to reportlab flowables... | |
import xml.sax as sax | |
def html_to_rl(html, styleSheet): | |
elements = list() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Displaying the HID stream without any decoding (not so helpful): | |
# od -t x1 -v --width=7 /dev/hidraw0 | |
Example packet: | |
01 Start | |
00 Position data | |
00 Position data | |
00 Position data | |
00 Position data | |
00 Keys on top |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# coding=utf-8 | |
# Copyright (C) 2012 Marian Beermann | |
# | |
# This program is free software: you can rediunicodeibute 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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# 4chan downloader | |
# Copyright (C) 2012 Marian Beermann | |
# | |
# 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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
digraph posting { | |
subgraph cluster_post { | |
label="Wie Beiträge verfasst werden"; | |
"Beitrag lesen" | |
-> "Beitrag verstehen" | |
-> "Unklare Wörter nachschlagen" | |
-> "[zitieren] drücken" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <avr/io.h> | |
int main(void) | |
{ | |
DDRB = 0x02; | |
PORTB = 0x00; | |
while(1) { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void gps_init() | |
{ | |
FIL nmea; | |
uint16_t last_size = eeprom_read_word(&ee_init_size); | |
if(f_open(&nmea, "/initseq.txt", FA_READ) == FR_OK) { | |
uint16_t size = f_size(&nmea); | |
if(size > 1024) { | |
// Use EEPROM block, sequence in file is too large |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
from urllib.request import urlretrieve | |
stories = { | |
"see": (".gif", 84), | |
"order": (".gif", 744), | |
"vattu": (".png", 354), | |
} | |
other_ext = [".gif", ".png"] |