Skip to content

Instantly share code, notes, and snippets.

View gypsydave5's full-sized avatar
👨
Growing an Alan Kay Tribute moustache

David Wickes gypsydave5

👨
Growing an Alan Kay Tribute moustache
View GitHub Profile
@gypsydave5
gypsydave5 / mermaid.md
Created October 11, 2023 11:12 — forked from martinwoodward/mermaid.md
GitHub HTML Rendering Pipeline
```mermaid
sequenceDiagram
    participant dotcom
    participant iframe
    participant viewscreen
    dotcom->>iframe: loads html w/ iframe url
    iframe->>viewscreen: request template
    viewscreen->>iframe: html & javascript
 iframe->>dotcom: iframe ready
@gypsydave5
gypsydave5 / Main.kt
Last active September 28, 2023 13:43
Generate some markdown from my oreilly notes
import org.apache.commons.csv.CSVFormat
import org.apache.commons.csv.CSVParser
fun main() {
val reader = object {}.javaClass.getResourceAsStream("/oreilly-annotations.csv")?.bufferedReader()!!
val csvParser = CSVParser(reader, CSVFormat.DEFAULT.withFirstRecordAsHeader());
val bookTitle = "Release It!, 2nd Edition"
@Test
fun `a request, when converted toCurl and then parsed back from cURL, is the identical`() {
// provide the seed as the first argument to `randomly` to make it repeatable
randomly {
repeat(20) {
println(Int.random(1, 100))
}
}
@gypsydave5
gypsydave5 / expand-collapse-list-css.html
Created April 27, 2023 11:45
quick little expand collapse list in HTML/CSS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
#tog {
display: none;
Error in user YAML: (<unknown>): mapping values are not allowed in this context at line 1 column 28
---
title: SRAPI Specifications: Fast and Right
description: How we did SRAPI
published: false
date: 2022-09-28 16:55:04
tags:

---

Abstract

Error in user YAML: (<unknown>): mapping values are not allowed in this context at line 1 column 28
---
title: SRAPI Specifications: Fast and Right
description: How we did SRAPI
published: false
date: 2022-09-28 16:55:04
tags:

---

Abstract

Error in user YAML: (<unknown>): mapping values are not allowed in this context at line 1 column 28
---
title: SRAPI Specifications: Fast and Right
description: How we did SRAPI
published: false
date: 2022-09-28 16:55:04
tags:

---

Abstract

@gypsydave5
gypsydave5 / cachingmw.go
Created July 13, 2022 15:37
caching middleware
package handler
import (
"io"
"net/http"
"strings"
)
func NewCachingMW(proxy http.Handler) http.Handler {
cache := make(map[string]http.Response)
package acceptance_test
import (
"log"
"os"
"os/exec"
"strings"
"testing"
)