Skip to content

Instantly share code, notes, and snippets.

View steventux's full-sized avatar

Steve Laing steventux

View GitHub Profile
@steventux
steventux / test-1.json
Created November 5, 2024 14:02
Integration test JWKS file
{
"keys": [
{
"kty": "RSA",
"n": "qsafH_xs2ybuDRKY3grBWSi_4mDptG2m7P8D2AzVAKf0mv8bijY3tY-zZlSg2YeA_W-40koyIdinTr2ynNWSBRNSmMRwBtGX5mG5jBVyxOBESIY5kXCVTj7IEmRc3LCI2YiB0w6m4LcS9zYXnO3A5xMde7Cy7SSIywe8Ch7cG4pf1pWQ00u8RSVOCkhPlzJaKHp8fcCkzgSD3E-hXHbRVVDkivPaT9M3m97aoGEcQaVPX4bBXgF8KPEgQYGjua71QlWkFJd8_R6kPugePf0mndukNOoDbVHQJ9kch1xhOGvROPChp3PCc8nzmFqaA2IvJN7ls1LOgAHBlAjzS8Sb5iID-VhreWZ-UKMh5t9QGRUFz3VIkAtxzGuDtB6Zi4dKmfY-q5bO6MwtqEc2Lzm02yj8A0lCe6s4iivKjhoimBNBl3JqspxvXyoysrtqTJEuN9QmXiKGuX1uAHqT2K5oywhyCIkZJxue5ykYAFu3gRUCB-JvbVAyM_BH5vBJNE49KlQS3MBrk9-Wgttfur1Kh_fwOIHFZ_1uyfoGSBH70Egi8eoRkrnMkoeZsiogxP-dzICDmas3B5ebfjswfwK-LfVksysIKBynC1FsHyt_3_EtflJDpDPlTEz1rhrKCQ3_r3PkNFAHD9Va5CGEZVqs1iqs4z4a04yyxtmpJYCEk18",
"e": "AQAB",
"alg": "RS512",
"kid": "test-1",
"use": "sig"
}
@steventux
steventux / function_app.py
Last active October 16, 2024 11:43
Azure function in python triggered by blob storage
import csv
import hashlib
import logging
import requests
import time
import uuid
import azure.functions as func
import azurefunctions.extensions.bindings.blob as blob
app = func.FunctionApp(http_auth_level=func.AuthLevel.ANONYMOUS)
@steventux
steventux / devtools setup
Created November 22, 2018 19:47
Quick script to set up vim and git prompt
#!/bin/bash
# Save git-prompt script to home dir
echo "Fetching git prompt script"
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh > ~/.git-prompt.sh
echo "Adding git-prompt to bash"
# Source it and amend bash prompt
cat << 'END' >> ~/.bashrc
@steventux
steventux / git_object_size.sh
Created July 24, 2018 10:50
List the largest git repo objects
#!/bin/bash
git_dir=$1
cd $git_dir && git rev-list --objects --all | git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' | sed -n 's/^blob //p' | sort --numeric-sort --key=2 | cut -c 1-12,41- | numfmt --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest | awk '$2 >= 2^20'
@steventux
steventux / links_by_schema.rb
Created October 11, 2017 15:09
Gets all links property keys for all frontend schemas (from alphagov/govuk-content-schemas).
@steventux
steventux / keybase.md
Created July 21, 2017 14:05
Android created Gist

Keybase proof

I hereby claim:

  • I am steventux on github.
  • I am steventux (https://keybase.io/steventux) on keybase.
  • I have a public key ASD9SOh3M6teaR0nXLNPurnavumlBt-UXt5t7fxVHrfMowo

To claim this, I am signing this object:

@steventux
steventux / technology.json
Last active August 16, 2016 15:34
Service Manual section example
{
"content_id": "c0f55d25-e6f6-4a7b-9142-0be5e07b734e",
"publishing_app": "manuals-publisher",
"rendering_app": "manuals-frontend",
"format": "manual_section",
"locale": "en",
"update_type": "major",
"base_path": "/service-manual/technology",
"public_updated_at": "2016-05-23T12:57:18Z",
"title": "Technology",
@steventux
steventux / manual.json
Last active August 16, 2016 14:48
Common manual schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"additionalProperties": false,
"required": [
"child_section_groups"
],
"properties": {
"body": {
"type": "string",
@steventux
steventux / manual_section.json
Last active August 17, 2016 08:57
Common manual section schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"additionalProperties": false,
"required": [
"manual"
],
"properties": {
"section_id": {
"type": "string",
Started GET "/foreign-travel-advice/spain" for ::1 at 2016-02-24 16:35:21 +0000
Processing by TravelAdviceController#show as HTML
Parameters: {"country_slug"=>"spain"}
Rendered govuk_component/breadcrumbs (0.7ms)
Rendered govuk_component/title (1.0ms)
Rendered travel_advice/_travel_advice_navigation.html.erb (7.7ms)
Rendered govuk_component/metadata (8.9ms)
Rendered govuk_component/govspeak (0.8ms)
Rendered travel_advice/_country_summary.html.erb (54.9ms)
Rendered govuk_component/related_items (2.0ms)