Skip to content

Instantly share code, notes, and snippets.

<div class="header-proposition">
<div class="content">
<nav id="proposition-menu" role="navigation">
<a href="/performance" id="proposition-name">
Performance <span class="alpha-tag">Alpha</span>
</a>
<ul id="proposition-links">
<li><a href="/foo">Foo</a></li>
</ul>
</nav>
[
{
"data-set": "tax_disc_application_type",
"seconds-out-of-date": 121212,
"last-updated": "2014-01-01T12:13:14+00:00",
"expected": "2014-05-01T12:13:14+00:00"
}
]
@alexmuller
alexmuller / lpa_volumes_migration.txt
Created July 16, 2014 13:40
lpa_volumes migration
Data set name: lpa_volumes
Data group: lasting-power-of-attorney
Data type: volumes
Upload format: excel
Upload filters: backdrop.core.upload.filters.first_sheet_filter
@alexmuller
alexmuller / gist:681ddbd49824b7d23b9b
Last active August 29, 2015 14:04
GOV.UK 503 sample
Date Total pageviews Pageviews that 503'd * "Downtime"
23 Jul 6038047 41 0.0006%
22 Jul 6381255 17 0.0002%
21 Jul 6985471 9 0.0001%
20 Jul 3390299 3 0.00009%
19 Jul 3162768 7 0.0002%
18 Jul 5099756 5 0.0001%
17 Jul 5955733 41 0.0007%
@alexmuller
alexmuller / commands.txt
Last active August 29, 2015 14:06
Creating a dashboard using cURL
curl -X POST https://stagecraft.preview.performance.service.gov.uk/dashboard --header "Authorization: Bearer $NAYEEMA_TOKEN" --header "Content-type: application/json" --data @dashboard.json
curl -X POST https://stagecraft.preview.performance.service.gov.uk/module-type --header "Authorization: Bearer $NAYEEMA_TOKEN" --header "Content-type: application/json" --data @module_type.json
curl -X POST https://stagecraft.preview.performance.service.gov.uk/dashboard/UPDATE_THIS/module --header "Authorization: Bearer $NAYEEMA_TOKEN" --header "Content-type: application/json" --data @module.json
@alexmuller
alexmuller / itertools.py
Created September 16, 2014 10:33
WTForms serialisation of modules
def select_modules(dictionary):
return {k: v for k, v in mydict.items() if k.startswith('modules-')}
def module_key(item):
return item[0].split('-')[1]
def sort_modules(modules):
return sorted(modules.iteritems(), key=module_key)
def group_modules(modules):
{:timestamp=>"2014-09-17T14:37:09.249000+0000", :message=>"ATTENTION: THIS PLUGIN WILL BE REMOVED IN LOGSTASH 1.2.0. YOU MAY CONTINUE USING IT. WHEN REMOVED, TO LEARN HOW TO REPLACE THIS PLUGIN, SEE THIS URL: http://cookbook.logstash.net/recipes/syslog-pri/", :level=>:warn}
<div class="col-sm-12">
<div class="pull-right">
{% if loop.index0 > 0 %}
<button type="submit" class="btn btn-default" name="move_module_up_{{ loop.index0 }}">
<span class="glyphicon glyphicon-arrow-up"></span> Move module up
</button>
{% endif %}
{% if form.modules|length > loop.index %}
<button type="submit" class="btn btn-default" name="move_module_down_{{ loop.index0 }}">
<span class="glyphicon glyphicon-arrow-down"></span> Move module down
@alexmuller
alexmuller / disks.diff
Created October 7, 2014 13:40
Multiple disks in Vagrant and VirtualBox
diff --git a/Vagrantfile b/Vagrantfile
index 88c7485..0118176 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -115,6 +115,9 @@ Vagrant.configure("2") do |config|
modifyvm_args << "--memory" << "1024"
end
vb.customize(modifyvm_args)
+ file_to_disk = './tmp/large_disk.vdi'
+ vb.customize ['createhd', '--filename', file_to_disk, '--size', 512]