Skip to content

Instantly share code, notes, and snippets.

@bhyde
bhyde / transcript
Last active August 29, 2015 14:10
pylint install failure, syntax errors?! under pyenv//2.6.9
$ pyenv versions
system
2.6.9
* 2.7.8 (set by /home/bhyde/.../.python-version)
$ ls ~/.pyenv/versions/
2.6.9 2.7.8
$ rm -rf ~/.pyenv/versions/2.6.9
$ pyenv install 2.6.9
Downloading Python-2.6.9.tgz...
-> https://yyuu.github.io/pythons/7277b1285d8a82f374ef6ebaac85b003266f7939b3f2a24a3af52f9523ac94db
;;; package --- autoname remote shell buffers
;;; Commentary:
;; Adjustments to comint's shell mode.
;;; Code:
;; This is based on my-shell in http://www.emacswiki.org/emacs/ShellMode
@bhyde
bhyde / jpsearch.py
Created August 10, 2015 21:55
A python implementation of https://github.com/jmespath/jp
#!/bin/env python
"""
USAGE: jpsearch [--unquoted|-u] [-f|--filename <json-file>] <JMESPath>
Reads json from standard input, or the file
if given. Then searches that as instructed
by the JMESPath; and prints the result. If
the result is a string and --unquoted is given
the string is printed without quotation. See
also http://jmespath.org/
"""
Freetype yearns for /opt/local/lib/libz.dylib , but (No such file or directory)
bash-3.2# uname -a
Darwin d72.cozy.org 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386
bash-3.2# port selfupgrade
Unrecognized action "selfupgrade"
bash-3.2# port selfupdate
---> Updating the ports tree
---> Updating MacPorts base sources using rsync
MacPorts base version 1.8.1 installed,
#!/usr/bin/env python
# With luck this illustrates 2 things r. keyczar
# 1. How to convert an RSA private key into a RSA public key.
# 2. How to convert RSA keys of either kind into their PEM
# equivaletn.
import sys
try:
import simplejson as json
@bhyde
bhyde / gist:5355435
Last active December 16, 2015 01:29
Load this into your lisp, and then goto http://localhost:8081/SyntaxHighlighter-1 for an example of using Alexgor Batchev javascript, client side, syntax highlighter via Common Lisp, Hunchentoot, cl-who, and parenscript
; -*- Mode: Common-Lisp -*
;;; A stand alone example of using Alex Batchev's javascript, client side,
;;; syntax highlighter <http://alexgorbatchev.com/SyntaxHighlighter/>
;;; via Common Lisp, Hunchentoot, cl-who, and parenscript.
(ql:quickload '(hunchentoot cl-who parenscript))
(defpackage #:script-highlighter-example
(:use #:common-lisp #:hunchentoot #:cl-who #:parenscript))
@bhyde
bhyde / gist:5383182
Last active December 16, 2015 05:18
# Quick start script for heroku-buildpack-ccl64-example1
# Pipe this into bash.
function LOG(){
cat <<EOF
=== LOG: $* ===
EOF
}
@bhyde
bhyde / gist:5722301
Created June 6, 2013 15:15
An alternate binding for slime's slime-documentation-lookup-function. Uses l1sp.org if invoked with a prefix arg.
(defun slime-hyperspec-plus-l1sp-lookup (symbol-name)
"The usual hyperspec lookup, but with a prefix arg uses l1sp.org instead"
(interactive (list (let* ((symbol-at-point (slime-symbol-at-point))
(stripped-symbol
(and symbol-at-point
(downcase
(common-lisp-hyperspec-strip-cl-package
symbol-at-point)))))
(if (and stripped-symbol
(or current-prefix-arg
@bhyde
bhyde / redirect.md
Last active December 18, 2015 03:59
Code to scrap cl-ppcre's doc page and build the redirect table as used by l1sp.org.
@bhyde
bhyde / slime-documentation-search.el
Last active December 18, 2015 05:48
Hand off slime doc search to a website, bound to C-c C-d C-s, defaults to quickdocs.org.
;;; -*- lexical-binding: t -*-
(define-slime-contrib slime-documentation-search
"Hand off a documenation search to a web site."
(:authors "Ben Hyde <bhyde@pobox.com>")
(:license "GPL")
(:on-load
(define-key slime-doc-map "\C-s" 'slime-documention-search)
(define-key slime-doc-map "s" 'slime-documention-search)))