Skip to content

Instantly share code, notes, and snippets.

@iegik
iegik / sfddiff.sh
Last active January 27, 2021 09:19
FontForge scripts
#!/usr/local/bin/fontforge
#This is the sfddiff script which compares two fonts
if ( Strtol($version) < 20060330 )
Error( "Please upgrade to a more recent version of fontforge" )
endif
flags=0x789
outfile=""
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@grugq
grugq / gist:03167bed45e774551155
Last active April 15, 2025 11:22
operational pgp - draft

Operational PGP

This is a guide on how to email securely.

There are many guides on how to install and use PGP to encrypt email. This is not one of them. This is a guide on secure communication using email with PGP encryption. If you are not familiar with PGP, please read another guide first. If you are comfortable using PGP to encrypt and decrypt emails, this guide will raise your security to the next level.

Android Kiosk

Tested on ~20 Samsung Tab 4 8.0 (SM-T330NU) running 4.4.2 but unfortunately no other devices.

If the tablet already has the extremely extremely obnoxious Samsung demo mode you'll need to do a factory reset. Go to Samsung demo settings from the notification tray, first password is 5444, admin password to factory reset is M729Q16K8546.

Enable Development options by going to Settings -> General -> About device and tapping on the Build number ~8 times. When development options appear enable USB debugging (Stay awake is also a option to enable for a kiosk.)

Install Towelroot, launch it and click the magic button. You now have root and can uninstall Towelroot. This will allow us to completey remove the top bar later.

<?php
/**
* A utility class to clean up common problems with UTF-8 strings.
*/
class UnicodeUtils{
/**
* Maps double-encoded UTF-8 byte sequences back to single encoded UTF-8. The keys are byte sequences where a valid
* UTF-8 character has been interpreted as multiple characters in CP1252, and then re-converted
@jbenet
jbenet / tikz2svg
Last active November 30, 2022 04:34
tikz2svg - convert tikz input into svg
#!/usr/bin/env python
#
# author: github.com/jbenet
# license: MIT
#
# tikz2svg: convert tikz input into svg
# depends on:
# - pdflatex: comes with your tex dist
# - pdf2svg: brew install pdf2svg
@jazzido
jazzido / index.html
Last active November 8, 2024 00:42
Webcam barcode reading (zbar, emscripten)
<!DOCTYPE html>
<html>
<head>
<title>JS in-browser barcode reader</title>
<style type="text/css">
body > div {
position: relative;
width: 320px; height: 240px;
}
video { position: absolute; top: 0; left: 0; width: 320px; height: 240px; }
@llb4ll
llb4ll / README.md
Last active June 17, 2023 09:48 — forked from patricksurry/README.md
k-nearest-neighbor search using D3 quadtrees

This example was inspired by patricksurry's D3JS quadtree nearest neighbor algorithm and finds the k-nearest neighbors (shown red) of a new point (shown yellow) using D3's Quadtrees. Orange points are visited but not selected. k is fixed to 10 for this demo.

Choose a new point to classify by clicking on the diagram.

The algorithm is based on one very simple but effective incremental approach first proposed by Hjaltason and Samet in their Ranking in Spatial Databases in 1995.

@fogonwater
fogonwater / README.md
Last active May 15, 2019 18:29
Hexagonal cartogram of electorate results from 2011 New Zealand election.
@romanbb
romanbb / gist:8011102
Last active April 11, 2022 01:58
compile, push, and start SystemUI.apk
#!/bin/bash
. build/envsetup.sh
mmm frameworks/base/packages/SystemUI/
adb start-server
adb shell pkill -TERM -f com.android.systemui
adb remount
adb push $OUT/system/priv-app/SystemUI.apk /system/priv-app/SystemUI.apk
adb shell pkill -TERM -f com.android.systemui
adb shell chmod 0644 /system/app-priv/SystemUI.apk
sleep 2