Skip to content

Instantly share code, notes, and snippets.

View benspaulding's full-sized avatar

Ben Spaulding benspaulding

View GitHub Profile
@benspaulding
benspaulding / update-chromium.sh
Created January 14, 2010 21:13
Script to update Mac Chromium to the latest build.
#!/bin/bash
# Script to update Mac Chromium to the latest build.
# Personally, I drop this in my ~/Library/Scripts dir and run in from the
# Script menu item in the menu bar.
# NOTE: Chromium must not be running when this is run.
export APP_DIR="$HOME/Applications/Browsers"
export LATEST_BUILD=`curl --silent "http://build.chromium.org/buildbot/snapshots/chromium-rel-mac/LATEST"`
if (window.location !== window.top.location)
window.top.location = window.location;
@benspaulding
benspaulding / znc.conf
Created March 2, 2010 19:16
Upstart config for ZNC
# znc - irc bouncer
description "IRC bouncer."
start on runlevel [2345]
stop on runlevel [!2345]
respawn
exec znc
{{ foobar }}{# <- Nothing #}
{% if foobar %}
{% load wowzers %}{# <- Still throws an error #}
{% endif %}
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>Logic block test</title>
<h1>Logic block test</h1>
<p>It appears to me that template tags within “skipped” logic blocks are
actually evaluated. The code below throws an error when the either of the
<code>load</code> or <code>firstof</code> statements is uncommented.
Environment:
Request Method: GET
Request URL: http://localhost:8000/
Django Version: 1.1.3 pre-alpha
Python Version: 2.6.1
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
@benspaulding
benspaulding / indexes.py
Created December 11, 2010 22:21
A custom RealTimeSearchIndex that also removes objects from the index when saved such that they should be.
from django.db.models import signals
from haystack import indexes
class RealTimeSearchIndex(indexes.RealTimeSearchIndex):
"""
A variant of the stock ``RealTimeSearchIndex`` that constantly keeps the
index fresh, including removing an object when it is saved to a state such
that it should no longer be in the index. (The latter is not done by the
@benspaulding
benspaulding / Application.applicationWillSwitchOut.applescript
Created October 14, 2011 17:56
AppleScript that will save all documents with unsaved changes when BBEdit loses focus.
(*
File:
Application.applicationWillSwitchOut.scpt
Abstract:
This script will automatically save all on-disk text documents with unsaved
changes when BBEdit loses focus.
Version:
@benspaulding
benspaulding / ReadMe.rst
Created October 16, 2011 04:33
Intelligently rename active document in BBEdit.

BBEdit Rename Active Document Script

The script itself has most of the documentation. Just know that there are two scripts here:

  1. A plain-text version (.applescript)
  2. A compiled version (.scpt)
@benspaulding
benspaulding / ReadMe.rst
Created October 17, 2011 01:24
Scripts for using BBEdit, TextWrangler, or MacVim as default command line EDITOR.

EDITOR Helpers

Author

Ben Spaulding

This is a collection of helper scripts for using popular Mac text editors as your terminal EDITOR.

These are certainly not essential, as all of the editors helped here ship with a powerful command-line utility. However, to properly use them for something like