Skip to content

Instantly share code, notes, and snippets.

View adamh's full-sized avatar

Adam Hockensmith adamh

View GitHub Profile
@adamh
adamh / make_hacker_news_bearable.js
Last active June 2, 2023 20:56
A one-liner to make news.ycombinator.com somewhat more bearable.
(function(){document.querySelectorAll('td.subtext a[href*="item?id="]').forEach(x=>{x.hidden=true})})()
@adamh
adamh / init.lua
Created February 9, 2019 21:05
Hammerspoon replacement for shiftit
units = {
right30 = { x = 0.70, y = 0.00, w = 0.30, h = 1.00 },
right50 = { x = 0.50, y = 0.00, w = 0.50, h = 1.00 },
right70 = { x = 0.30, y = 0.00, w = 0.70, h = 1.00 },
left70 = { x = 0.00, y = 0.00, w = 0.70, h = 1.00 },
left50 = { x = 0.00, y = 0.00, w = 0.50, h = 1.00 },
left30 = { x = 0.00, y = 0.00, w = 0.30, h = 1.00 },
top50 = { x = 0.00, y = 0.00, w = 1.00, h = 0.50 },
bot50 = { x = 0.00, y = 0.50, w = 1.00, h = 0.50 },
upright30 = { x = 0.70, y = 0.00, w = 0.30, h = 0.50 },
@adamh
adamh / PdfUtil.scala
Created June 4, 2014 03:29
markdownj (markdown to html to pdf)
import org.xhtmlrenderer.pdf.ITextRenderer
import org.ccil.cowan.tagsoup.Parser
import org.apache.xalan.xsltc.trax.SAX2DOM
import org.xml.sax.InputSource
import com.petebevin.markdown.MarkdownProcessor
import org.xml.sax
import java.io.{ByteArrayOutputStream, FileOutputStream, File, ByteArrayInputStream}
object PdfUtil {