Skip to content

Instantly share code, notes, and snippets.

@AndreKR
AndreKR / draw_text.go
Created March 14, 2017 09:03
Three ways of drawing text in go
// Initialize an empty image
dest := image.NewRGBA(image.Rect(0, 0, 800, 300))
// Draw a white background
draw.Draw(dest, dest.Bounds(), &image.Uniform{color.White}, image.ZP, draw.Src)
// Read the font
fontBytes, err := ioutil.ReadFile(exeDir + "/DejaVuSans.ttf")
if err != nil {
@aerth
aerth / 10-evdev.conf
Last active May 9, 2017 20:21
Disable Laptop Keyboard && Use USB Keyboard Instead ( good for broken laptop keys )
## /etc/X11/xorg.conf.d/10-evdev.conf
## Disable laptop's built-in keyboard (in X session)
## Does not disable on the kernel level
## Does not disable while ctrl+alt+f1 etc
## Useful for placing a USB keyboard on top of laptop's (broken) keyboard as to not accidentally input keys.
## <aerth@riseup.net>
##
## You may have to create the xorg.conf.d directory.
## Something like:
## mkdir-p /etc/X11/xorg.conf.d
@laanwj
laanwj / run.gdbscript
Last active March 24, 2022 14:39
Start bitcoind in a screen in a debugger
set disable-randomization off
set $_exitcode = -999
set height 0
handle SIGTERM nostop print pass
handle SIGPIPE nostop
define hook-stop
if $_exitcode != -999
quit
else
shell echo | mail -s "NOTICE: app has stopped on unhandled signal" root
echo "# Contributors" > CONTRIBUTORS.md && git log --pretty=tformat:"* %an <%ae>" | tac | awk ' !x[$0]++' >> CONTRIBUTORS.md
@joelittlejohn
joelittlejohn / generate-contributors.sh
Created May 22, 2013 22:08
Instant CONTRIBUTORS.md from your git log
echo "# Contributors" > CONTRIBUTORS.md && git log --pretty=tformat:"* %an <%ae>" | tac | awk ' !x[$0]++' >> CONTRIBUTORS.md