Skip to content

Instantly share code, notes, and snippets.

See https://github.com/genmon/aboutfeeds/tree/main
@dragon-dxw
dragon-dxw / gist:0a3aa35ba776db3944b054dd35e3e55e
Created February 22, 2024 12:46
Marklogic facetting example
xquery version "1.0-ml";
import module namespace search =
"http://marklogic.com/appservices/search"
at "/MarkLogic/appservices/search/search.xqy";
let $options :=
<search:options>
<search:constraint name="decade">
<search:range type="xs:date" facet="true">
@dragon-dxw
dragon-dxw / gist:be645e180c25d8e7c07caf1a1c431443
Created October 16, 2023 13:05
List of existing features
xquery version "1.0-ml";
declare namespace uk="https://caselaw.nationalarchives.gov.uk/akn";
declare namespace akn="http://docs.oasis-open.org/legaldocml/ns/akn/3.0";
let $uri := "/eat/2023/1.xml"
let $doc := fn:doc($uri)
return (
<root>
<tdr-ref>
{xdmp:document-get-properties($uri, xs:QName("transfer-consignment-reference"))//text()}
# pip install diff_match_patch
import diff_match_patch as dmp_module
dmp = dmp_module.diff_match_patch()
diff = dmp.diff_main("Hello World.", "Goodbye World.")
dmp.diff_cleanupSemantic(diff)
print(dmp.diff_prettyHtml(diff))
Top 10 slowest examples (20.5 seconds, 7.2% of total time):
Users can view activities when the user is signed in as a BEIS user they can see and navigate current delivery partner activities
4.3 seconds ./spec/features/staff/users_can_view_activities_spec.rb:17
Users can create a project when they are a delivery parther when viewing a programme a new project can be added to the programme
2.48 seconds ./spec/features/staff/users_can_create_a_project_level_activity_spec.rb:16
I18n does not have missing keys
2.35 seconds ./spec/i18n_spec.rb:9
Users can create a third-party project when the user does NOT belong to BEIS when viewing a project a new third party project can be added to the project
2.23 seconds ./spec/features/staff/users_can_create_a_third_party_project_level_activity_spec.rb:18
Users can view activities when the user is signed in as a delivery partner when viewing the activities index page they can see and navigate current delivery partner activities
repos:
- repo: https://github.com/dragon-dxw/pre-commit
rev: v0-0-gb466a5ad3865f76962644c97f8eb731cbecf8b85
hooks:
- id: standardrb
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.8.0.3
hooks:
- id: shellcheck
#- repo: https://github.com/mattlqx/pre-commit-ruby