Skip to content

Instantly share code, notes, and snippets.

View blude's full-sized avatar
💜
PICO-8

Sarah Pratti blude

💜
PICO-8
View GitHub Profile
import SwiftUI
import PlaygroundSupport
struct app: View {
var appTitle: String
var appDesc: String
var appColor: Color
var body: some View {
HStack (alignment: .center, spacing: 14) {
VStack {
import SwiftUI
import Combine
struct HMS {
var h: Int
var m: Int
var s: Int
}
struct ContentView: View {
@HarshilShah
HarshilShah / LabeledContainer.swift
Created March 5, 2020 14:27
A basic attempt at recreating the Form SwiftUI component on macOS
import SwiftUI
struct LabeledViewAlignment: AlignmentID {
static func defaultValue(in context: ViewDimensions) -> CGFloat {
context[.leading]
}
}
extension HorizontalAlignment {
static let labeledViewAlignment = HorizontalAlignment(LabeledViewAlignment.self)
final class Loader: BindableObject {
let didChange = PassthroughSubject<Data?, Never>()
var task: URLSessionDataTask!
var data: Data? = nil {
didSet {
didChange.send(data)
}
}
init(_ url: URL) {
@bpolania
bpolania / DataExtensions.swift
Last active January 25, 2024 07:10
Swift Extensions for Data, Int, UInt8, UInt16, and UInt32 types
// MIT License
// Copyright (c) 2018 Boris Polania
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@nahuelDeveloper
nahuelDeveloper / CalculatorView.swift
Created October 4, 2017 12:49 — forked from natecook1000/CalculatorView.swift
An IBInspectable Calculator Construction Set
// CalculatorView.swift
// as seen in http://nshipster.com/ibinspectable-ibdesignable/
//
// (c) 2015 Nate Cook, licensed under the MIT license
import UIKit
/// The alignment for drawing an String inside a bounding rectangle.
enum NCStringAlignment {
case LeftTop
@ayamflow
ayamflow / gist:b602ab436ac9f05660d9c15190f4fd7b
Created May 9, 2016 19:10
Safari border-radius + overflow: hidden + CSS transform fix
// Add on element with overflow
-webkit-mask-image: -webkit-radial-gradient(white, black);
@nickloewen
nickloewen / bret_victor-reading_list.md
Last active March 7, 2024 18:14
Bret Victor’s Reading List

This is a plain-text version of Bret Victor’s reading list. It was requested by hf on Hacker News.


Highly recommended things!

This is my five-star list. These are my favorite things in all the world.

A few of these works have had an extraordinary effect on my life or way of thinking. They get a sixth star. ★