Skip to content

Instantly share code, notes, and snippets.

View sebbacon's full-sized avatar

Seb Bacon sebbacon

View GitHub Profile
@sebbacon
sebbacon / xapian-1.2.9.patch
Created March 14, 2012 09:08
patch to xapian-full to sync it with current xapian version
diff --git a/Rakefile b/Rakefile
index b2e1737..13a487f 100644
--- a/Rakefile
+++ b/Rakefile
@@ -6,7 +6,7 @@ def system!(cmd)
system(cmd) or raise
end
-ver = '1.2.3'
+ver = '1.2.9'
@sebbacon
sebbacon / packages.diff
Created May 3, 2012 09:45
Differences to `config/packages` since previous release (0.5.1)
diff --git a/config/packages b/config/packages
index 76a5c29..b59c61b 100644
--- a/config/packages
+++ b/config/packages
@@ -2,13 +2,12 @@
# mysociety deployment infrastructure -- please discuss on the
# alavateli mailing list if you want to change it
ruby1.8
-libpgsql-ruby1.8
-libopenssl-ruby1.8
@sebbacon
sebbacon / 1-follow.png
Created May 16, 2012 10:14
Screenshots of new "follow" functionality
1-follow.png
Robin
@sebbacon
sebbacon / index.html
Created November 6, 2012 11:14 — forked from mbostock/.block
Mobile Patent Suits
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Mobile Patent Suits</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.29.1"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.js?1.29.1"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?1.29.1"></script>
<style type="text/css">
@sebbacon
sebbacon / bob.json
Last active April 16, 2024 09:41
Click-to-edit force directed graph in d3
{"nodes":[{"name":"Myriel","group":1},{"name":"Napoleon","group":1},{"name":"Mlle.Baptistine","group":1},{"name":"Mme.Magloire","group":1},{"name":"CountessdeLo","group":1},{"name":"Geborand","group":1},{"name":"Champtercier","group":1},{"name":"Cravatte","group":1},{"name":"Count","group":1},{"name":"OldMan","group":1}],"links":[{"source":0,"target":1,"value":1},{"source":1,"target":2,"value":8},{"source":1,"target":3,"value":10},{"source":3,"target":4,"value":1},{"source":3,"target":5,"value":1},{"source":4,"target":6,"value":1},{"source":6,"target":7,"value":1},{"source":1,"target":4,"value":2},{"source":7,"target":8,"value":1},{"source":8,"target":9,"value":1},{"source":1,"target":9,"value":1},{"source":3,"target":9,"value":1}]}
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Force-Directed Graph</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.25.0"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.js?1.25.0"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?1.25.0"></script>
<style type="text/css">
@sebbacon
sebbacon / gist:178a8e3b5625f79919ad
Created June 20, 2014 12:58
bot with writeable data dir
require 'json'
require 'turbotlib'
Turbotlib.log("Starting scrape...")
state_file = open("#{Turbotlib.data_dir}/state.txt", "w")
(1...20).each do |n|
data = {
number: n,
message: "Hello #{n}",
@sebbacon
sebbacon / setup
Last active August 29, 2015 14:04
Demonstrating different behaviour between GET and POST for search queries. Hard to reproduce on a fresh install, as relates to size of index. Can reproduce on our production server, which is 10Gi with 13,286,926 items
# Set up the index and type and mappings
curl -XPOST "http://localhost:9200/bork"
curl -XPOST "http://localhost:9200/bork/user/_mapping" -d '
{
"user":{
"properties":{
"data_type":{
"index":"not_analyzed",
"type":"string"
@sebbacon
sebbacon / gist:27f081763d19d86e93ca
Created December 12, 2014 09:45
Getting median dates for all jurisdictions via ElasticSearch
require 'elasticsearch'
client = Elasticsearch::Client.new(:host => "elasticsearch-lb")
results = client.search(
:index => 'openc_production',
:type => 'company',
:body => {
"query"=> {
"filtered"=> {
"query"=> {
"match_all"=> {}