Skip to content

Instantly share code, notes, and snippets.

View lgessler's full-sized avatar

Luke Gessler lgessler

View GitHub Profile
@lgessler
lgessler / mini_concordancer.js
Created February 17, 2016 06:05
TamperMonkey script that lets open my browser console and generate concordances from my MiniMongo collection over a regex
// ==UserScript==
// @name Bindi Assistant
// @namespace lgessler
// @version 0.1
// @description Offer convenience functions
// @author Luke Gessler
// @match https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo/related?hl=en
// @grant unsafeWindow
// ==/UserScript==
/* jshint -W097 */

Keybase proof

I hereby claim:

  • I am lgessler on github.
  • I am lgessler (https://keybase.io/lgessler) on keybase.
  • I have a public key whose fingerprint is 604C B0CC 9184 06FE 2748 A9DF 4DBD 5A3A 26F8 E8E0

To claim this, I am signing this object:

@lgessler
lgessler / pull_covers.py
Created March 15, 2016 18:20
Pull all album covers from a Subsonic server
import libsonic
import pickle
import os
from getpass import getpass
from time import sleep
from pprint import pprint
conn = libsonic.Connection(
'http://your.subsonic.com',
'admin',

Here are the crontab entries: (put in with crontab -e)

59 23 * * 6 /home/luke/bin/record-2h-general.sh sunday "AM 00"
59 7 * * 0 /home/luke/bin/record-2h-general.sh sunday "AM 08"
59 9 * * 0 /home/luke/bin/record-2h-general.sh sunday "AM 10"
59 11 * * 0 /home/luke/bin/record-2h-general.sh sunday "PM 00"
59 13 * * 0 /home/luke/bin/record-2h-general.sh sunday "PM 02"
59 15 * * 0 /home/luke/bin/record-2h-general.sh sunday "PM 04"
59 17 * * 0 /home/luke/bin/record-2h-general.sh sunday "PM 06"
59 19 * * 0 /home/luke/bin/record-2h-general.sh sunday "PM 08"
;; not modularized but is DRY as far as subs go
(defn top []
(fn []
(let [foo (sub [:foo])
bar (sub [:bar])]
[:div
[:span (str @foo @bar)]
[:span @foo]])))
@lgessler
lgessler / publish.el
Last active June 22, 2018 15:50
lgessler.com org-publish config
;; this goes inside of (defun dotspacemacs/user-config ... in .spacemacs
(defun ldg/lgessler.github.io/publish ()
(interactive)
(org-publish "lgessler.github.io"))
(setq ldg/disqus-html-block
"#+BEGIN_EXPORT html
<div id=\"disqus_thread\"></div>
<script>
var disqus_config = function () {
@lgessler
lgessler / compute_agreement.py
Last active October 25, 2018 17:40
For LING 463, HW4 at Georgetown
import os
import argparse
from openpyxl import load_workbook
from collections import defaultdict
def xlsx_files(directory):
return [x for x in os.listdir(directory) if x.endswith("xlsx")]
def get_tags(dir1, dir2, tag_column):
dir1_files = xlsx_files(dir1)
@lgessler
lgessler / hindmonocorp_process.py
Last active December 3, 2018 06:05
Take HindMonoCorp's format and prepare it for CWB
import traceback
filename = 'sample.txt'
filename = 'hindmonocorp05.export'
errct = 0
with open('hindmonocorp.out','w') as f:
f.write('<text id="hmc0000001">\n')
sentcount = 0
partcount = 1
@lgessler
lgessler / macros.cljs
Last active March 14, 2019 18:34
Clojure macro demo for Anish
;; Preliminaries ------------------------------------------------------------
;; Clojure has namespaces. vars can be created in namespaces and referenced
;; from other namespaces.
(ns glam.db) ;; Switch into namespace glam.db
(var x 1) ;; define var glam.db/x
x ;; `x` evals to 1
;;=> 1
(ns glam.other) ;; switch to other namespace
from validator import Validator
from ..ether import ExportConfig, ether_to_sgml, get_socialcalc
from ..gitdox_sql import get_doc_info
from paths import ether_url
import re
import tempfile
# TODO: would have been ideal to write this without any filesystem operations
class BulkExportValidator(Validator):
def __init__(self, rule):