Skip to content

Instantly share code, notes, and snippets.

Avatar

Sean Hammond seanh

View GitHub Profile
View diff.diff
diff --git a/h/static/scripts/app.coffee b/h/static/scripts/app.coffee
index 62cccba..5c98e67 100644
--- a/h/static/scripts/app.coffee
+++ b/h/static/scripts/app.coffee
@@ -112,6 +112,7 @@ module.exports = angular.module('h', [
.directive('match', require('./directive/match'))
.directive('tabbable', require('./directive/tabbable'))
.directive('tabReveal', require('./directive/tab-reveal'))
+.directive('scrollToMe', require('./directive/scrolltome'))
View gist:9b62745737d3ea7f5b1d
(DataError) invalid input syntax for type numeric: " " LINE 2: VALUES (' ', to_tsvector(' ')); ^ 'INSERT INTO "0b12b45b-32c0-4408-a8d8-2a17da72294d" ("value", "_full_text")\n VALUES (%s, to_tsvector(%s));' [(9750, '9750'), (9751, '9751'), (9752, '9752'), (9753, '9753'), (9754, '9754'), (9755, '9755'), (9756, '9756'), (9757, '9757') ... displaying 10 of 250 total bound parameter sets ... (9998, '9998'), (u' ', ' ')]
@seanh
seanh / Install.txt
Last active Aug 29, 2015
ckanext-deadoralive demo
View Install.txt
pip install ckanext-deadoralive
Add deadoralive to ckan.plugins in config file
Create a user for the link checker
Add ckanext.deadoralive.authorized_users to config file
Restart CKAN
pip install deadoralive
deadoralive --url ... --apikey ...
Add cron job
View bundles.vim
" I manage my vim plugins using vundle:
"
" https://github.com/gmarik/vundle
"
" This file contains my vundle config settings, and also any
" plugin-specific config settings that won't work (and might
" cause vim to complain) if the plugins aren't installed.
"
" To install all the plugins (or any newly added plugins) on a new machine,
" do :BundleInstall in vim or on the command line:
@seanh
seanh / openbox_shutdown_window.py
Created Sep 2, 2013
A GUI window presenting logout, suspend, shutdown, reboot options. Uses GTK 2.0 and dbus.
View openbox_shutdown_window.py
#!/usr/bin/env python
import pygtk
pygtk.require('2.0')
import gtk
import os
import dbus
class LogoutWindow:
@seanh
seanh / gist:5736861
Created Jun 8, 2013
Scraper for the 130 1600x1200 wallpapers from the [National Geographic Photo Contest 2012](http://ngm.nationalgeographic.com/ngm/photo-contest/2012/), saves having to click on each one manually.
View gist:5736861
#!/usr/bin/env python2
"""
Scrapes all the 1600x1200 wallpapers from the National Geographic Photo Contest
2012: <http://ngm.nationalgeographic.com/ngm/photo-contest/2012>
This just prints out the URLs, you can pipe them to a file and then use wget
to download them:
./scrape.py > wallpapers.txt && wget -i wallpapers.txt
View gist:5541662
#!/bin/bash
cd /usr/lib/ckan/sa/src/ckanext-datastorer/ && /usr/lib/ckan/sa/bin/paster datastore_upload -c /etc/ckan/sa/production.ini
@seanh
seanh / README.md
Last active Dec 16, 2015
Proposed new CKAN documentation outline, for comments
View README.md

Aims:

  • The structure/organization should be simple and immediately obvious so that:
    1. Readers can find stuff
    2. Devs know where new docs should go, or what docs need to be updated if they've change something
  • Structure is more "flat" with less generic sections, hopefully this makes the structure clearer
  • The stuff under the top-level heading "Installation" is meant to take you through a complete install, deployment and basic customisation, the idea is that we (the ckan dev team) would follow this when deploying new client sites, instead of having our own wiki pages etc.
  • Probably Overview and Contact will be pulled into Sphinx from the top-level README file, so they will also appear on the github front-page
  • Changelog is pulled-in from the top-level CHANGELOG file
@seanh
seanh / README.md
Last active Mar 27, 2021
My ZSH prompt in Python
View README.md

My ZSH prompt in Python, with:

  • A horizontal rule (as wide as the terminal) before each prompt (when scrolling this makes it easier to see where one command's output ends and the next command begins)
  • Nicely truncated current working directory (like fish shell)
  • Active virtualenv
  • Git branch
  • Non-zero exit status
  • user@host only if connected over ssh
View gist:4996091
Watching /home/seanh/Projects/ckan/ckan/ckan/public/base/less
An error occurred running the less command:
Command failed: TypeError: Cannot call method 'charAt' of undefined
at getLocation (/home/seanh/Projects/ckan/ckan/node_modules/less/lib/less/parser.js:212:34)
at new LessError (/home/seanh/Projects/ckan/ckan/node_modules/less/lib/less/parser.js:221:19)
at Object.toCSS (/home/seanh/Projects/ckan/ckan/node_modules/less/lib/less/parser.js:385:31)
at /home/seanh/Projects/ckan/ckan/node_modules/less/bin/lessc:107:28
at /home/seanh/Projects/ckan/ckan/node_modules/less/lib/less/parser.js:434:40
at /home/seanh/Projects/ckan/ckan/node_modules/less/lib/less/parser.js:94:48
at /home/seanh/Projects/ckan/ckan/node_modules/less/lib/less/index.js:116:17