Skip to content

Instantly share code, notes, and snippets.

@brimston3
brimston3 / clfontpng.cc
Last active December 11, 2023 23:43 — forked from jokertarot/clfontpng.cc
How to render color emoji font with FreeType 2.12
// = Requirements: freetype >=2.5, libpng, libicu, libz, libzip2,
// = with freetype >=2.10, libbrotli
// = How to compile:
// % export CXXFLAGS=`pkg-config --cflags freetype2 libpng`
// % export LDFLAGS=`pkg-config --libs freetype2 libpng libbrotlidec libbrotlicommon`
// % clang++ -o clfontpng -static $(CXXFLAGS) clfontpng.cc $(LDFLAGS) \
// -licuuc -lz -lbz2
#include <cassert>
#include <cctype>
#include <iostream>
@brimston3
brimston3 / face_show.py
Created November 14, 2022 22:04
face landmarks tutorial (just the code bits, not the explanations)
#!/usr/bin/env python3
# Dear future me, you probably just want these commands:
'''
source py_fl/bin/activate
python3 face_show.py --shape-predictor shape_predictor_68_face_landmarks.dat --image face.jpg
'''
# If you're reading this file, I strongly suggest going to the source:
# https://pyimagesearch.com/2017/04/03/facial-landmarks-dlib-opencv-python/
@brimston3
brimston3 / RaiseOutlookReminders.au3
Created February 5, 2020 17:12
Autoit3 script: Set legacy Outlook Calendar Reminders to Always On Top
#cs
Copyright (C) February 05, 2020, Andrew Domaszek
(MIT License)
This script finds the calendar reminders dialog and sets the always on top attribute
without stealing focus. It checks every 2 seconds.
This fixes the problem where Outlook calendar reminders do not appear over other
windows in Windows 10 anymore (it pops under existing windows).
@brimston3
brimston3 / vector_nlp_options.mkd
Last active May 4, 2019 00:00
Anki Vector Speech NLP options

Anki Vector Speech NLP Options

One of the major issues with Anki going out of business is Vector voice recognition ending, rendering Vector deaf. Voice NLP currently uses a remote processing platform.

I've put the current english voice commands in a separate gist here: Vector voice commands

Local Device Processing

@brimston3
brimston3 / vector_voice_commands.mkd
Last active May 13, 2019 19:29
Anki Vector voice commands

"Hey Vector" Voice Commands

  • Go to sleep, Good night
  • Hello
  • Good [morning / afternoon / evening]
  • Goodbye
  • What time is it?
  • Go home, Go to your charger
@brimston3
brimston3 / gist:79f661accbceb9e4b3ac3c52ab1cb036
Last active December 8, 2020 19:53
Anki Vector boot up (115200 8N1)
Format: Log Type - Time(microsec) - Message - Optional Info
Log Type: B - Since Boot(Power On Reset), D - Delta, S - Statistic
S - QC_IMAGE_VERSION_STRING=BOOT.BF.3.1.2.C2-00037
S - IMAGE_VARIANT_STRING=DAASANAZA
S - OEM_IMAGE_VERSION_STRING=CRM
S - Boot Config, 0x000000e1
B - 1566 - PBL, Start
B - 4542 - bootable_media_detect_entry, Start
B - 43424 - bootable_media_detect_success, Start
B - 43428 - elf_loader_entry, Start
@brimston3
brimston3 / git_repack_all.zsh
Created April 19, 2019 13:17
gc repack prune all visible git working repositories
#!/bin/zsh
# Can't figure out how this works or why you might want to do this? Don't do it.
# Don't. Do. It.
pushd
locate -b '\.git' | while read -t 1 repo
do
cd "$(dirname "$repo")"
git gc
@brimston3
brimston3 / usr.lib.firefox.firefox
Created January 31, 2019 14:00
firefox customizations for esr.
# vim:syntax=apparmor
# ------------------------------------------------------------------
#
# Copyright (C) 2009-2011 Canonical Ltd.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License published by the Free Software Foundation.
#
# ------------------------------------------------------------------
@brimston3
brimston3 / treescan.cpp
Created October 15, 2018 19:19
T-9 dict search
// g++ -Wall -std=c++14 -o treescan treescan.cpp && time ./treescan
// just goofin' around, searching for words in phone T-9 numbers.
#include <iostream>
#include <fstream>
#include <assert.h>
#include <string>
#include <array>
#include <algorithm>
@brimston3
brimston3 / expand_certs_inline.awk
Created October 13, 2018 07:57
Inline expand x509 certificates using awk to buffer and openssl to parse.
# openssl s_client -connect google.com:443 -showcerts </dev/null | awk -f expand_certs_inline.awk
#or pack it all into one line, see if I care.
BEGIN{
e="";
flag=0;
ssl_proc_cmd="openssl x509 -noout -text";
}
/-----BEGIN CERTIFICATE/{
e=$0 "\n";