Skip to content

Instantly share code, notes, and snippets.

View mattorp's full-sized avatar

Mathias Torp mattorp

  • Denmark
View GitHub Profile
@overengineer
overengineer / git-json.sh
Last active July 20, 2022 14:34
git log json format
#!/usr/bin/env bash
# Caution: It can break
# Bash unofficial strict mode
set -euo pipefail
IFS=$'\n\t'
LANG=''
function define() { IFS='\n' read -r -d '' ${1} || true; }
@cmstead
cmstead / gist:7ad64539d13dfdb5a2591bc3be3c8eeb
Last active March 3, 2024 06:40
VS Code snippet transform: convert camel case to Pascal case or vice versa
// If you want to convert a PascalCase variable to camelCase, you can do the following:
// Where `n` is the tab stop you want to reference
${n/^(.)(.*)$/${1:/downcase}${2}/}
// Example: ${1:This is my original} => ${1/^(.)(.*)$/${1:/downcase}${2}/}
// If you want to convert a camelCase variable to PascalCase, you can do the following:
// Where `n` is the tab stop you want to reference
${n/^(.)(.*)$/${1:/upcase}${2}/}
@Thomvis
Thomvis / SwiftUI-Circular.swift
Last active August 4, 2021 21:41
Rough attempt at creating a container view that lays out its children in a circle #SwiftUI
struct ContentView: View {
@State var count: Int = 3
var body: some View {
return NavigationView {
VStack(spacing: 50) {
HStack {
Button(action: { self.count += 1 }) {
Text("Add")
}