Bash script to:
- Iterate all commits made within a Git repository.
- List every object at each commit.
let keyWindow = UIApplication.shared.connectedScenes | |
.filter { $0.activationState == .foregroundActive } | |
.map { $0 as? UIWindowScene } | |
.compactMap { $0 } | |
.first?.windows | |
.filter { $0.isKeyWindow } | |
.first | |
// Usage e.g. | |
_ = keyWindow?.safeAreaInsets.bottom ?? 0 |
#!/bin/sh | |
# | |
# pull-all-repos.sh | |
set -euo pipefail | |
for d in */; do cd $d; git stash; (git pull &); cd ..; done |
import SwiftUI | |
import UIKit | |
extension View { | |
func cornerRadius(_ radius: CGFloat, corners: UIRectCorner) -> some View { | |
clipShape(RoundedCorner(radius: radius, corners: corners)) | |
} | |
} | |
private struct RoundedCorner: Shape { |
import SwiftUI | |
import UIKit | |
struct BlurView: UIViewRepresentable { | |
var style: UIBlurEffect.Style = .systemMaterial | |
func makeUIView(context: Context) -> UIVisualEffectView { | |
return UIVisualEffectView(effect: UIBlurEffect(style: style)) | |
} |
[ | |
{ | |
"key": "ctrl+shift+u", | |
"command": "editor.action.transformToUppercase", | |
"when": "editorTextFocus" | |
}, | |
{ | |
"key": "ctrl+shift+l", | |
"command": "editor.action.transformToLowercase", | |
"when": "editorTextFocus" |
#!/bin/bash | |
find . -type f -size +100000k -exec ls -lh {} \; |
{ | |
"extends": ["prettier", "plugin:prettier/recommended"], | |
"plugins": ["prettier", "import"], | |
"rules": { | |
"import/order": [ | |
"error", | |
{ | |
"groups": ["builtin", "external", "parent", "sibling", "index"], | |
"pathGroups": [ | |
{ |
uuid () { | |
local newuuid=${$(uuidgen):l} | |
echo -n ${newuuid} | pbcopy | |
echo "copied ${newuuid} to clipboard" | |
} |
function buildPrismaWithQueryDebugging( | |
sqlQueryReportingThresholdMs: number, | |
prismaActionReportingThresholdMs: number | |
) { | |
const prisma = new PrismaClient({ | |
log: [ | |
{ | |
emit: "event", | |
level: "query", |