Skip to content

Instantly share code, notes, and snippets.

View GeorgeWS's full-sized avatar

George Woodliff-Stanley GeorgeWS

View GitHub Profile
import SwiftUI
extension CGPoint {
static func *(lhs: Self, rhs: CGFloat) -> Self {
.init(x: lhs.x * rhs, y: lhs.y * rhs)
}
}
// Idea: https://www.framer.com/showcase/project/lo2Qka8jtPXrjzZaPZdB/
@StarLard
StarLard / DetentSheet.swift
Last active January 7, 2023 07:22
A simple implementation of an UISheetPresentationController wrapper using SwiftUI
//
// DetentSheet.swift
// StarLardKit
//
// Created by Caleb Friden on 9/28/21.
//
import SwiftUI
// MARK: - Public
@aplekhanov
aplekhanov / Color+UIColors.swift
Last active January 21, 2024 17:17
SwiftUI system colors extension
import SwiftUI
extension Color {
// MARK: - Text Colors
static let lightText = Color(UIColor.lightText.cgColor)
static let darkText = Color(UIColor.darkText.cgColor)
static let placeholderText = Color(UIColor.placeholderText.cgColor)
// MARK: - Label Colors
@ciceronianus
ciceronianus / Roam-count_mentions.css
Created March 4, 2021 16:20
Roam-count-mentions (alpha)
/* Just a simple experiment :) */
/* Counts mentions of a page */
/* Syntax: Count:: {{[[mentions]]: [[Tweet]]}} */
[data-page-links*='\"Count\"'] > .rm-block-main
> .roam-block > span > .rm-reference-main {
display:inline-block;
}
[data-page-links*='\"Count\"'] > .rm-block-main
@malcolmocean
malcolmocean / Roam Custom DB Styles.css
Last active September 13, 2021 10:06
Malcolm's custom roam styles
/* If you copy this, keep the malcolmocean one and the metaroam one, as these are both public roams */
/* but change the other ones for your personal roam(s) */
@-moz-document url-prefix("https://roamresearch.com/#/app/metaroam") {
.roam-sidebar-content > .flex-h-box:first-child:after {
color: white;
padding-left: 10px;
}
.roam-topbar .flex-h-box > div:nth-child(2) {
padding-left: 30px;
}
@masamichiueta
masamichiueta / Color.swift
Created October 21, 2019 09:25
Bridge UIColor system color to SwiftUI Color
import UIKit
import SwiftUI
extension Color {
static var label: Color {
return Color(UIColor.label)
}
static var secondaryLabel: Color {
@pirate
pirate / alfred-clipboard.sh
Last active June 7, 2024 08:52
Script to manage searching, backing up, and collecting infinite clipboard history from the Alfred Clipboard History on macOS.
#!/usr/bin/env bash
# This is a script that provides infinite history to get around Alfred's 3-month limit.
# It works by regularly backing up and appending the items in the alfred db to a
# sqlite database in the user's home folder. It also provides search functionality.
# https://www.alfredforum.com/topic/10969-keep-clipboard-history-forever/?tab=comments#comment-68859
# https://www.reddit.com/r/Alfred/comments/cde29x/script_to_manage_searching_backing_up_and/
# Example Usage:
# alfred-clipboard.sh backup
@Kiran-B
Kiran-B / DeveloperColorPicker.colorPicker-macOS-Catalina.md
Last active February 17, 2024 10:56
Making Panic's Developer ColorPicker (DeveloperColorPicker.colorPicker) work in macOS BigSur & macOS Catalina

Context

Panic's Developer ColorPicker (v1.5.4) does not work in macOS Catalina or macOS BigSur. This is due to enforcement of code-signing. Until Panic releases a newer version that supports Catalina/BigSur, below is the workaround.

Prerequisite

You need a Developer Account. This could be a free account. Refer: https://9to5mac.com/2016/03/27/how-to-create-free-apple-developer-account-sideload-apps/

Get the latest version of developer-color-picker

https://panic.com/blog/developer-color-picker-1-5/

@zaydek-old
zaydek-old / bookmark.min.js
Last active May 28, 2024 19:18
A *simple* CSS debugger. To use, bookmark "Debug CSS" at https://zaydek.github.io/debug.css. Learn more here https://medium.freecodecamp.org/88529aa5a6a3 and https://youtu.be/2QdzahteCCs?t=1m25s (starts at 1:25)
/* debug.css | MIT License | zaydek.github.com/debug.css */ if (!("is_debugging" in window)) { is_debugging = false; var debug_el = document.createElement("style"); debug_el.append(document.createTextNode(`*:not(g):not(path) { color: hsla(210, 100%, 100%, 0.9) !important; background: hsla(210, 100%, 50%, 0.5) !important; outline: solid 0.25rem hsla(210, 100%, 100%, 0.5) !important; box-shadow: none !important; filter: none !important; }`)); } function enable_debugger() { if (!is_debugging) { document.head.appendChild(debug_el); is_debugging = true; } } function disable_debugger() { if (is_debugging) { document.head.removeChild(debug_el); is_debugging = false; } } !is_debugging ? enable_debugger() : disable_debugger();
@werner-freytag
werner-freytag / AnyEquatable.swift
Created March 1, 2018 11:17
Allow any protocol to conform to Equatable using a wrapper
import Foundation
protocol AnyEquatableWrappable {
func isEqualTo(_ other: AnyEquatableWrappable) -> Bool
var asEquatable: AnyEquatable { get }
}
extension AnyEquatableWrappable where Self: Equatable {
func isEqualTo(_ other: AnyEquatableWrappable) -> Bool {
guard let other = other as? Self else { return false }