Skip to content

Instantly share code, notes, and snippets.

@PhilHudson
PhilHudson / Info.plist.patch
Created May 24, 2013 18:11
Shell script for pulling the latest Conkeror from git and building it.
--- Contents/Info.plist 2012-02-17 06:47:35.000000000 +0000
+++ foo/Info.plist 2012-02-15 14:02:14.000000000 +0000
@@ -2,6 +2,32 @@
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
+ <key>CFBundleSignature</key>
+ <string>CNKR</string>
+ <key>CFBundleIdentifier</key>
+ <string>org.mozdev.conkeror</string>
@PhilHudson
PhilHudson / setup_timekpr
Created December 10, 2013 11:19
Install and configure timekpr on debian-derived GNU/Linux
#!/usr/bin/env bash
# USE AT OWN RISK. Read, understand and adapt.
# Part of my suite of new host configuration scripts
# $1: operating system, either 'linux', 'darwin', *bsd or 'cygwin'
if [ $# != 1 ]; then
echo "Usage: $0 os" 1>&2
exit 1
@PhilHudson
PhilHudson / clean-up-org-mobile-cruft.el
Last active August 29, 2015 14:02
Excise spurious Org agenda buffers leaked by org-mobile
(eval-when-compile
(require 'syntactic-sugar) ; for `then'
(require 'anaphora)) ; for `awhen'
(require 'org-mobile)
(defun ph/clean-up-org-mobile-cruft ()
"Excise spurious Org agenda buffers leaked by org-mobile."
(awhen (get-buffer "*SUMO*")
(then

Keybase proof

I hereby claim:

  • I am philhudson on github.
  • I am dije (https://keybase.io/dije) on keybase.
  • I have a public key whose fingerprint is 5D85 6F7D 2095 A1D7 4847 30E2 1A36 6FB6 4E48 2F85

To claim this, I am signing this object:

clear Mod1
clear Mod2
clear Mod3
clear Lock
!clear Mod4
keycode 63 = Mode_switch
keycode 71 = Mode_switch
keycode 66 = Meta_L
keycode 69 = Meta_R
keycode 65 = Super_L
# -*- mode: snippet -*-
# name: add-to-list
# key: atl
# --
(add-to-list '${1:list} ${2:element}${3: ${4:&optional append-flag$$(yas-choose-value '("nil" "'append"))}${5: #'${6:compare-fn}}})$0
@PhilHudson
PhilHudson / shell_command_output.fail.js
Created April 9, 2015 11:52
Failing attempt to get shell command output in Conkeror
function shell_command_output (command) {
var error_text = "";
var output_text = "";
var exit_status = shell_command(
command,
$fds = [
{
output:
async_binary_string_writer("")
},
@PhilHudson
PhilHudson / shell-escaper.el
Created April 14, 2015 19:30
Shell-escape a string in Elisp
(defun ph/shell-escaper (matched-text)
"Return replacement text for MATCHED-TEXT when shell-escaping.
See `ph/shell-escape'."
(cond
;; Already escaped?
((string= matched-text "\\'")
"’")
;; Leading?
((string= matched-text "'")
(defun ph/yank-quote (&optional arg)
"Yank, passing optional prefix ARG to `yank', and quote."
(interactive "*P")
(yank arg)
(let
((end-marker (copy-marker (point-marker) t))
(start-marker (copy-marker (mark))))
(string-rectangle start-marker end-marker "> ")
(fill-region start-marker end-marker)))
// Time-stamp: "2015-05-03 14:02:16 phil"
// Section 7x is for Conkeror internal tweaks (?)
dumpln("72theme");
// Example: darken Astronomy Picture of the Day (APOD)
// register_user_stylesheet(
// make_css_data_uri(["body{background: black !important; color: grey !important;}",
// ":link, :link * {color: #4986dd !important;}",
// ":visited, :visited * {color: #d75047 !important;}"],
// $url_prefixes = "http://apod.nasa.gov/apod/"));