Skip to content

Instantly share code, notes, and snippets.

@ritobanrc
ritobanrc / minimal_gtk_cairo_example.py
Last active February 12, 2024 19:40
A minimal example for using Cairo in a GTK `DrawingArea` in Python
"""
A minimal example for using Cairo with GTK
"""
import cairo
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Gdk, GLib
@precurse
precurse / gist:af9907010ba597b5261f40fd5885660c
Last active May 7, 2024 14:43
FT2232H Mini Pinout (JTAG, SPI, UART, I2C)

I made this reference guide so I can easily look back on it quickly.

FT2232H IC FT2232H Mini JTAG SPI UART I2C
GND CN2-2, 4, 6 GND GND GND GND
VCC CN2-1, 3, 5 3.3VDC 3.3VDC 3.3VDC 3.3VDC
AD0 CN2-7 TCK SCLK TXD SK
AD1 CN2-10 TDI DO (MOSI) RXD DO
AD2 CN2-9 TDO DI (MISO) DI
@chrisdone
chrisdone / gist:02e165a0004be33734ac2334f215380e
Last active May 26, 2024 13:57
Build and run minimal Linux / Busybox systems in Qemu

Common

export OPT=/opt
export BUILDS=/some/where/mini_linux
mkdir -p $BUILDS

Linux kernel

@KristobalJunta
KristobalJunta / display-layout.sh
Created December 14, 2016 12:59
A script to display current keyboard layout in i3status
#!/bin/bash
# a shell scipt to prepend i3status with more stuff
i3status --config ~/.i3status.conf | while :
do
read line
LG=$(setxkbmap -query | awk '/layout/{print $2}')
echo "LG: $LG | $line" || exit 1
done
@balasankarc
balasankarc / odftest
Last active January 29, 2024 17:19
Basic stuff with odfpy
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from odf.opendocument import OpenDocumentText
from odf.style import (Style, TextProperties, ParagraphProperties,
ListLevelProperties, TabStop, TabStops)
from odf.text import (H, P, List, ListItem, ListStyle, ListLevelStyleNumber,
ListLevelStyleBullet)
from odf import teletype
@michaelmrose
michaelmrose / zathu
Created September 12, 2015 01:45
zathura config
# Zathura configuration file
# See man `man zathurarc'
# Open document in fit-width mode by default
set adjust-open "best-fit"
# One page per row by default
set pages-per-row 1
#stop at page boundries