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
@evdb
evdb / gist:6867195
Last active December 24, 2015 21:39
evdb@custard-2 ~ $ virtualenv .venv
New python executable in .venv/bin/python
Installing setuptools............done.
Installing pip...............done.
evdb@custard-2 ~ $ source .venv/bin/activate
(.venv)evdb@custard-2 ~ $ pip install scraperwiki
@evdb
evdb / gist:6918398
Last active December 25, 2015 04:38
(pombola-virtualenv)mzalendo-staging@ajax:/data/vhost/za-pombola.staging.mysociety.org/pombola$ ./manage.py
...snip...
[za_hansard]
hansard_check_for_new_sources
hansard_load_into_sayit
hansard_run_parsing
pmg_scraper
questions
za_hansard_check_for_new_sources
za_hansard_load_into_sayit
@evdb
evdb / models.py
Last active December 30, 2015 05:48
from django.db import models
from autoslug import AutoSlugField
from pombola.core.models import Person
# TODO
#
# - add a source for the data, possibly as a field on the Release?
# - resolve how to differentiate between items that are one-offs (like gift to person) and ongoing (like employment or land ownership). Concern is that one-offs may get lost if only the latest release is shown, or duplicated if they are included in several releases.
@evdb
evdb / .gitignore
Last active December 31, 2015 12:19
wip.csv
$a = 8;
$G{ int( ++$a / 9 ) . $a % 9 + 1 } = $_ for split //, <>;
@A = 1 .. 9;
sub c {
int( ( $_[0] - 1 ) / 3 ) * 3;
}
sub G {
for $y (@A) {
$a=8;$G{int(++$a/9).$a%9+1}=$_ for split//,<>;@A=1..9;sub c{int(($_[0]-1
)/3)*3}sub G{for$y(@A){for$x(@A){$t=$G{my$c=$y.$x}&&next;$t.=$G{$_.$x}.
$G{$y.$_}for@A;for$f(1..3){$t.=$G{c($y)+$f.c($x)+$_}for 1..3}G($G{$c}=$_
)for grep$t!~m/$_/,@A;return$G{$c}=0}}die map{$G{$_}||"\n"}9..100}G
use integer;@A=split//,<>;sub R{for$i(0..80){next if$A[$i];my%t=map{$_/9
==$i/9||$_%9==$i%9||$_/27==$i/27&&$_%9/3==$i%9/3?$A[$_]:0=>1}0..80;R($A[
$i]=$_)for grep{!$t{$_}}1..9;return$A[$i]=0}die@A}R
use integer;
@A = split //, <>;
sub R {
for $i ( 0 .. 80 ) {
next if $A[$i];
my %t = map {
$_ / 9 == $i / 9
|| $_ % 9 == $i % 9
|| $_ / 27 == $i / 27 && $_ % 9 / 3 == $i % 9 / 3
@evdb
evdb / NPR-fatty.rss
Last active June 20, 2017 10:44
Set dates correctly (I hope...)
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:itunes="http://www.itunes.com/DTDs/Podcast-1.0.dtd" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<title>Captain Fatty Lives the High Life on the High Seas</title>
<description>Weekend Edition Sunday follows Captain Fatty Goodlander as he sails through Southeast Asia and talks about his life at sea and his philosophy of freedom and discovery.</description>
<link>http://www.npr.org/templates/story/story.php?storyId=90411144</link>
<itunes:image href="https://media.npr.org/programs/wesun/features/2008/may/fatty540-47c249204d6b6e9d473df4cb080a6b88262e97e4.jpg" />
<pubDate>18 May 2008 00:01:00 EST</pubDate>
<language>en-us</language>
<copyright> 2017 NPR </copyright>
$a=8;$G{int(++$a/9).$a%9+1}=$_ for split//,<>;@A=1..9;sub c{int(($_[0]-1
)/3)*3}sub G{for$y(@A){for$x(@A){$p=$t=$G{my$c=$y.$x}&&next;$t.=$G{$_.$x
}.$G{$y.$_}for@A;for$f(1..3){$t.=$G{c($y)+$f.c($x)+$_}for 1..3}G($G{$c}=
$_)&&return for grep$t!~m/$_/,@A;return$G{$c}=0}}die map{$G{$_}}9..99}G