Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View evdb's full-sized avatar

Edmund von der Burg evdb

  • Stockholm, Sweden.
View GitHub Profile
app.use('/info', require('../lib/apps/info') );
input.csv
@evdb
evdb / gist:4558490
Created January 17, 2013 18:47
This is a very lightly edited transcript of a discussion that happened on 17 Jan 2013 over IRC in #mschat on irc.mysociety.org (times are UTC - 3 hours )
12:58 <jpmckinney> will do :) i was also wondering if you had thoughts re: https://github.com/mysociety/popit/issues/234
13:00 <evdb> It's an interesting one. One solution is to create a position with no person - currently I think that is not allowed by the validation.
13:01 <evdb> Also bad in that you'd have to remember to create the vacant positions everytime someone leaves the position.
13:01 <jpmckinney> yeah, i think having both a "posts" and an "appointments" (positions) model may be easier in the long-run
13:02 <jpmckinney> are you familiar with http://www.w3.org/TR/vocab-org/ ? they get into the different ways of modelling memberships in orgs
13:02 <jpmckinney> * and to also delete or update the vacant positions when someone takes the position
13:03 <evdb> vocab-org <-- I was not, will look at that, thank you.
13:04 <jpmckinney> from my reading of vocab-org, any system modelling people+orgs would probably need two ways to represent memberships - one where the "post" exists without anyone holding it, a
(mzalendo-virtualenv)evdb@custard-2 ~/git/mzalendo_root/mzalendo/mzalendo $ ./manage.py migrate core
Running migrations for core:
- Migrating forwards to 0037_migrate_data_for_parliamentary_sessions.
> core:0034_auto__add_blank_trues
> core:0035_auto__add_parliamentarysession
> core:0036_auto__add_field_place_parliamentary_session
> core:0037_migrate_data_for_parliamentary_sessions
Saving Senate (Governmental) to the database
Saving National Assembly 2007-2013 to the database
Saving National Assembly 2013- to the database
@evdb
evdb / simple_test.js
Last active December 15, 2015 03:49
correct case
"use strict";
var assert = require('assert'),
JSV = require("JSV").JSV;
function formatError (error) {
if (error) {
return error.message + ': ' + error.schemaUri;
} else {
return 'expected errors but got none';
@evdb
evdb / output.txt
Last active December 16, 2015 21:39
evdb@custard-2 ~/5501489 $ python xml-test.py
--- running tostring
--- result is:
This is
some
text…
(virtualenv-citizenconnect)evdb@custard-2 ~/mysociety/citizenconnect/citizenconnect $ python
Python 2.7.3 (default, Aug 8 2012, 14:50:51)
[GCC 4.2.1 Compatible Apple Clang 4.0 ((tags/Apple/clang-421.0.60))] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import urlparse
>>> o = urlparse.urlparse('http://foo.com/foo/bar?baz=bundy')
>>> o
ParseResult(scheme='http', netloc='foo.com', path='/foo/bar', params='', query='baz=bundy', fragment='')
>>> o.path = o.path + '.html'
Traceback (most recent call last):
#!/usr/local/bin/node
var _ = require('underscore'),
rest = require('restler'),
async = require('async');
// Get the mapit ids from command line
var ids = _.rest(process.argv, 2);
console.log(ids);
@evdb
evdb / gist:6436931
Created September 4, 2013 13:27
FMS vagrant file intended to be copied and used before cloning repo
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
{% if 53255 %}
<style>
.pds-box { width: 100% !important; }
#polldaddy { margin-bottom: 30px; }
</style>
<div id="polldaddy">
<h2>Latest Poll</h2>
<script type="text/javascript" charset="utf-8" src="http://static.polldaddy.com/w/53255.js"></script>
<noscript><a href="http://polldaddy.com/w.php?p=53255/">Take Our Poll</a></noscript>