Skip to content

Instantly share code, notes, and snippets.

@bsag
bsag / .slate
Created February 10, 2013 19:32
My Slate config
# My slate file
# 10-02-2013
# Basic mappings and bindings for moving screens around
# I have set up my right command key to trigger ctrl+alt+shift+cmd
# see http://stevelosh.com/blog/2012/10/a-modern-space-cadet/#hyper for details
config defaultToCurrentScreen true
config windowHintsShowIcons true
config windowHintsIgnoreHiddenWindows false
config windowHintsSpread true
@bsag
bsag / _config.yml
Last active December 11, 2015 23:28
Javascript to parse App.net RSS (cached locally) and generate an HTML widget listing recent posts (with links to source post). A fuller description here: http://www.rousette.org.uk/blog/archives/app-dot-net-widget/
# Excerpt...
# You want to add a section including your App.net details
# Then adn.html will pull the info into the template.
# App.net
adn_user: bsag
adn_post_count: 5
adn_cache_path: "/blog/data/adn.xml"
@bsag
bsag / panda.rb
Created December 3, 2012 18:49
Wrapper script for Pandoc. Sets some defaults and makes it easier to generate the small range of output formats I use. Requires the 'commander' gem.
#!/usr/bin/env ruby
require 'rubygems'
require 'commander/import'
program :version, '0.1'
program :description, 'Converts markdown documents into a variety of default formats using Pandoc'
CMD = "pandoc"
BIB = "$HOME/Dropbox/Documents/bibtex/all-refs.bib"
@bsag
bsag / README
Created January 4, 2012 10:34
Create a WXR-format export file to export comments from ExpressionEngine and import into Disqus
I had some difficulty trying to get a format exported from ExpressionEngine which I could use to import comments into Disqus, and eventually settled on the code above after looking at Disqus' own import format (http://docs.disqus.com/developers/export/import_format/) and trawling the ExpressionEngine forums to adapt other solutions which exported to Movable Type format.
You need to start off by creating a new template group called 'export'. Inside that, you make a template called 'index' and paste in the contents of index.xml above, making sure that you replace the channel name and template group name to those appropriate for your setup. This needs to be the index for the template group. Next, create another template called 'comments' and paste the contents of comments.xml, again, replacing the channel name as appropriate.
Now visit http://yoururl.com/export and you should see the exported entries. Wait for the whole page to load which may take some time with a lot of entries. Then use your browsers 'View s
@bsag
bsag / xmonad.hs
Created May 29, 2010 11:06
My xmonad.hs file, put together from some great examples on the XMonad wiki. Wish I could remember which and give credit!
{- xmonad.hs -}
-- Imports --
-- main
import XMonad
import IO (Handle, hPutStrLn)
-- utils
import qualified Data.Map as M
import XMonad.Util.Run (spawnPipe)
-- hooks
@bsag
bsag / conkyrc
Created May 15, 2010 18:18
conkyrc for bottom status bar on Xmonad
#On background
background no
cpu_avg_samples 2
use_xft
out_to_x no
out_to_console yes
@bsag
bsag / .bashrc
Created January 15, 2009 19:07 — forked from henrik/.bashrc
# http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
# username@Machine ~/dev/dir[master]$ # clean working directory
# username@Machine ~/dev/dir[master*]$ # dirty working directory
# bsag: I combined the best of both worlds and used the parse_git_dirty function here:
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/#comment-4166
# as well as various other mods from the forks of this gist.
function parse_git_dirty {
git diff --quiet HEAD &>/dev/null