Skip to content

Instantly share code, notes, and snippets.

View hoelzro's full-sized avatar

Rob Hoelz hoelzro

View GitHub Profile
@hoelzro
hoelzro / places-v.sql
Created November 19, 2017 04:22
SQLite view for making querying Firefox history easier
CREATE VIEW v as
select
datetime(hv.visit_date / 1000000, 'unixepoch') as visit_date,
p.title as title,
p.url as url,
datetime(fhv.visit_date / 1000000, 'unixepoch') as referrer_visit_date,
fp.title as referrer_title,
fp.url as referrer_url
from moz_historyvisits as hv
@hoelzro
hoelzro / mysql-editor.vim
Created October 31, 2017 16:50
A dumb vimscript "workbench" for sending queries to a MySQL shell in another tmux pane
function! SendSelectionToMySQL(start_line_no, end_line_no)
let lines = getline(a:start_line_no, a:end_line_no)
let index = 0
for line in lines
call system('tmux send-keys -l -t:.- ' . shellescape(line))
if index == len(lines) - 1
call system('tmux send-keys -t:.- ' . shellescape('\;') . ' Enter')
else
import functools
import inspect
from multiprocessing import Process
import os
import signal
import sys
import time
import traceback
# XXX specify # levels to skip, specify the frame you want to start with (in case called from a signal handler)
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("twitter.com") {
.tweet[data-you-follow=false]:not([data-retweeter])[data-component-context="suggest_activity_tweet"] {
display: none;
}
}

Keybase proof

I hereby claim:

  • I am hoelzro on github.
  • I am hoelzro (https://keybase.io/hoelzro) on keybase.
  • I have a public key ASCKavNtoQSQIDEh-8E57PkCXTDF3WQ2mykPol0H6CvxIQo

To claim this, I am signing this object:

module Connect4.Draw
import Data.Vect
import Connect4.Types
%access public export
topRow : String
topRow = "┌─┬─┬─┬─┬─┬─┬─┐\n"
@hoelzro
hoelzro / drive.lua
Created April 8, 2017 20:15
Throw commands into a terminal with a delay between each
local awful = require 'awful'
local gears = require 'gears'
local commands = [[
icdiff 1.py 2.py
python2 -m semantic_diff 1.py 2.py
icdiff 1.py 3.py
python2 -m semantic_diff 1.py 3.py
icdiff 1.py 4.py
python2 -m semantic_diff 1.py 4.py
function! DumpSynStack()
for id in synstack(line("."), col("."))
echo synIDattr(id, "name")
endfor
endfunction
map <F10> :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<'
\ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<"
\ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"<CR>
@hoelzro
hoelzro / Example.idr
Last active March 4, 2017 15:30
Possible Idris compiler bug
module Example
import Data.Nat.DivMod
nextBlockSize : Nat -> Nat
nextBlockSize k with (divMod k 511)
nextBlockSize (remainder + (quotient * 512)) | (MkDivMod quotient remainder remainderSmall) = ?nextBlockSize_rhs_1
@hoelzro
hoelzro / lookalikes.md
Last active February 22, 2017 17:48
Detecting lookalike characters for content filtration

Problem

People will use the wide range of Unicode characters to avoid content filters, whether it's filtering out things like swear words or spam. Examples of this include:

  • Using ∪ (U+22A UNION) as a substitute for u/U
  • Using 0 as a substitute for O
  • Using cyrillic characters (eg. а/о/у) as a substitute for Latin characters (see also Greek, Cherokee, etc)
  • Using Latin characters with diacritics, whether in precomposed or combining forms (eg. spám)