Skip to content

Instantly share code, notes, and snippets.

We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 4.
"","text","favorited","favoriteCount","replyToSN","created","truncated","replyToSID","id","replyToUID","statusSource","screenName","retweetCount","isRetweet","retweeted","longitude","latitude"
"1","My economic policy speech will be carried live at 12:15 P.M. Enjoy!",FALSE,9214,NA,2016-08-08 15:20:44,FALSE,NA,"762669882571980801",NA,"<a href=""http://twitter.com/download/android"" rel=""nofollow"">Twitter for Android</a>","realDonaldTrump",3107,FALSE,FALSE,NA,NA
"2","Join me in Fayetteville, North Carolina tomorrow evening at 6pm. Tickets now available at: https://t.co/Z80d4MYIg8",FALSE,6981,NA,2016-08-08 13:28:20,FALSE,NA,"762641595439190016",NA,"<a href=""http://twitter.com/download/iphone"" rel=""nofollow"">Twitter for iPhone</a>","realDonaldTrump",2390,FALSE,FALSE,NA,NA
"3","#ICYMI: ""Will Media Apologize to Trump?"" https://t.co/ia7rKBmioA",FALSE,15724,NA,2016-08-08 00:05:54,FALSE,NA,"762439658911338496",NA,"<a href=""http://twitter.com/download/iphone"" rel=""nofollow"">Twitter for iPhone</a>","realDonal
* Exercise - Latency as a Service
We're going to build a microservice to provide latency.
https://twitter.com/tenderlove/status/573907559871971328
- GET `/latency` - returns the string "OK" after 500ms
- GET `/latency?duration=100ms` - override the default delay duration. The value can be any string accepted by `time.ParseDuration`.
- An invalid duration parameter should return a 400 along with an error message.
Stretch goal: Add tests
@MatMoore
MatMoore / gist:33ddec403930817b982d4e9a7e54ca88
Created December 2, 2016 08:07
Whitehall tagging mission
This applies to
- Primary and secondary Specialist sectors
- Organisations
- (Policy areas)
- (Policies)
Design separate tagging interface
Policy areas and policies are optional (they could be treated as intrinsic links).
@MatMoore
MatMoore / self_assessment.yaml
Last active April 9, 2017 15:45
Whitehall search document example
description: 'Register for Self Assessment, sign in and send your Self Assessment tax return online'
format: guide
link: /log-in-file-self-assessment-tax-return
organisations:
- {title: 'HM Revenue & Customs', content_id: 6667cce2-e809-4e21-ae09-cb0bdc1ddda3, acronym: HMRC, link: /government/organisations/hm-revenue-customs, slug: hm-revenue-customs, organisation_type: non_ministerial_department, organisation_state: live}
public_timestamp: '2015-01-15T16:17:28.000+00:00'
specialist_sectors:
- {slug: business-tax/self-employed, title: Self-employment, content_id: 9741abcb-c246-4fd6-bff3-7cee244a9979, link: /topic/business-tax/self-employed}
- {slug: personal-tax/self-assessment, title: 'Self Assessment', content_id: 7beb97b6-75c9-4aa7-86be-a733ab3a21aa, link: /topic/personal-tax/self-assessment}
title: 'Register for and file your Self Assessment tax return'
@MatMoore
MatMoore / self_assessment_ms.md
Last active April 10, 2017 12:21
Mainstream search document

Hi, I'm a search document!

organisations:
    - hm-revenue-customs
popularity: 0.014925373134328358
public_timestamp: '2015-01-15T16:17:28.000+00:00'
specialist_sectors:
    - business-tax/self-employed
    - personal-tax/self-assessment
@MatMoore
MatMoore / gist:76aa1df81254bdca696b0d5ec3c4947f
Created May 19, 2017 15:31
Duplicate CMA Case 2017-05-19 16:31 BST
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 3,
"successful": 3,
"failed": 0
},
"hits": {
"total": 2,
@MatMoore
MatMoore / specialist_publisher.json
Last active May 22, 2017 10:08
Affected specialist publisher
// 20170522110859
// https://www.gov.uk/api/search.json?filter_public_timestamp=from:2017-05-18,to:2017-05-20&filter_publishing_app=specialist-publisher&filter_document_type=edition&fields[]=content_id&count=1000
{
"results": [
{
"content_id": "46fb4dec-d076-473a-8c42-f24d03e04b30",
"index": "mainstream",
"es_score": null,
"_id": "/drug-device-alerts/class-4-medicines-recall-sodium-cromoglicate-2-w-v-13-5-ml-eye-drops",
/hmrc-internal-manuals/double-taxation-relief/
/hmrc-internal-manuals/fraud-civil-investigation/
/hmrc-internal-manuals/tax-credits-manual/
/hmrc-internal-manuals/compliance-operational-guidance/
/hmrc-internal-manuals/cotax-manual/
/hmrc-internal-manuals/double-taxation-relief/
/hmrc-internal-manuals/labour-provider-operational-guidance/
/hmrc-internal-manuals/vat-small-and-medium-enterprises-assurance/
/hmrc-internal-manuals/compliance-handbook/
/hmrc-internal-manuals/machine-games-duty-manual/
@MatMoore
MatMoore / gist:5ac8232cb6d3089a30c0015af80ff7d9
Last active May 22, 2017 14:13
Publishing api editions with null public updated at
irb(main):015:0> pp Edition.where(public_updated_at: nil).group("DATE(updated_at)", "publishing_app").order('DATE(updated_at)').count; nil
{[Mon, 29 Feb 2016, "short-url-manager"]=>54,
[Mon, 29 Feb 2016, "hmrc-manuals-api"]=>16,
[Mon, 29 Feb 2016, "whitehall"]=>9,
[Mon, 29 Feb 2016, "service-manual-publisher"]=>48,
[Mon, 29 Feb 2016, "policy-publisher"]=>5,
[Mon, 29 Feb 2016, "contacts"]=>4,
[Tue, 08 Mar 2016, "collections-publisher"]=>1,
[Thu, 10 Mar 2016, "collections-publisher"]=>1096,
[Thu, 12 May 2016, "collections-publisher"]=>1097,
@MatMoore
MatMoore / live-search.md
Created October 10, 2017 16:49
Review of live search and analytics javascript

Review of live search and analytics javascript

Summary

  • Both have a form, a result count, and a results block.
  • Both update the results and result count after ajax requests
  • Both use mustache to render parts of the page dynamically
  • Both track ajax updates as new page views
  • Both support the history API
  • Both have a fallback if the history API isn't available