Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am query on github.
  • I am query (https://keybase.io/query) on keybase.
  • I have a public key ASCjx8qsk7Hy36SSLXtW_bc0XarsfQfROCcgQe2Y7baoewo

To claim this, I am signing this object:

@query
query / yosemify.css
Created November 2, 2014 13:45
I'm on Yosemite, random Web site! Get with the program!
@font-face {
font-family: 'Lucida Grande';
src: local('Helvetica');
}
@font-face {
font-family: 'Lucida Grande';
font-weight: bold;
src: local('Helvetica-Bold');
}
@query
query / assert-v0.14b.patch
Created April 17, 2014 14:37
Patches to make the ASSERT semantic role tagger install properly on Debian 7.1.
# The following patch file applies several fixes to the ASSERT v0.14b
# software distribution [1] such that the `./install.sh` script works
# properly on Debian 7.1. To apply it, use the following commands:
#
# $ cd assert-v0.14b/
# $ patch -p1 < patch.diff
#
# [1]: http://cemantix.org/software/assert.html
#
diff -ur a/bin/extract-propbank-features.csh b/bin/extract-propbank-features.csh
@query
query / virtualenv-fix.sh
Created January 23, 2014 19:15
Fix Python virtualenvs broken by a change of Python location. Intended to be used with Homebrew, whose Python installation path contains the version number and so changes on upgrades.
#!/bin/sh
# Find and delete broken symbolic links, which cause virtualenv to balk.
# "-L" resolves symbolic links to their destination if possible, meaning
# that if the filename is still a link ("-type l"), it's a broken one.
# Since "-L" doesn't work with "-delete", this calls "rm" instead.
find -L $1 -type l -exec rm -- {} +
# Just run virtualenv again to handle the rest.
virtualenv $1
@query
query / randopen.bash
Last active December 29, 2015 05:29
Open a random file selected from a specified directory and its subdirectories.
#!/bin/bash
#
# randopen.bash [-n] [DIR]
#
# Choose a random file selected from the directory DIR, or the current
# directory if it is not given, and its subdirectories. Output the
# selected file's name, and open it unless the `-n` option is given.
#
# Requires at least bash 3.1. `open` is specific to OS X and should be
# replaced on other platforms (e.g., `xdg-open`).
@query
query / Rules.rb
Created March 2, 2013 00:36
Simple nanoc handling of width and height for image items, using the "dimensions" Ruby gem.
preprocess do
@items.each do |item|
if %w{png gif jpg jpeg}.include? item[:extension]
dimensions = Dimensions.dimensions(item.raw_filename)
item[:img_width] = dimensions[0]
item[:img_height] = dimensions[1]
end
end
end
@query
query / helvetify.css
Last active October 11, 2015 02:37
User style sheet for replacing several varieties of Arial with Helvetica Neue.
@font-face {
font-family: 'Arial';
src: local('HelveticaNeue');
}
@font-face {
font-family: 'Arial';
font-weight: bold;
src: local('HelveticaNeue-Bold');
}
@query
query / rtorrent_xmlrpc.py
Created April 2, 2011 17:25
Python module for interacting with rtorrent's XML-RPC interface directly over SCGI.
#!/usr/bin/python
# rtorrent_xmlrpc
# (c) 2011 Roger Que <alerante@bellsouth.net>
#
# Python module for interacting with rtorrent's XML-RPC interface
# directly over SCGI, instead of through an HTTP server intermediary.
# Inspired by Glenn Washburn's xmlrpc2scgi.py [1], but subclasses the
# built-in xmlrpclib classes so that it is compatible with features
# such as MultiCall objects.