This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fs = require("fs"); | |
| const path = require("path"); | |
| const mds = fs.readdirSync("./").filter((f) => f.includes(".md")); | |
| let contents = ` | |
| --- | |
| title: Sonic Pi Tutorial | |
| author: Sam Aaron | |
| ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| enum CustomFont { | |
| static let notoEmoji = "NotoEmoji-SemiBold" | |
| } | |
| struct Emoji: View { | |
| var text: String | |
| var size: CGFloat | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| let rawKeys = [ | |
| ["q","w","e","r","t","y","u","i","o","p"], | |
| ["a","s","d","f","g","h","j","k","l"], | |
| ["z","x","c","v","b","n","m"] | |
| ] | |
| enum InputKey: Hashable, Equatable, Codable { | |
| case letter(key: String) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| // fuck it this should be fine-ish (as on main thread)? | |
| fileprivate var lastStartPoint: CGPoint? | |
| extension View { | |
| func quickTap(action: @escaping () -> Void) -> some View { | |
| gesture(DragGesture(minimumDistance: 0).onChanged { value in | |
| if value.startLocation == lastStartPoint { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function dl(url: string, title: string, idx: number): Promise<boolean> { | |
| const file = fs.createWriteStream(`./downloads/${pad(idx)}-${title}.mp4`) | |
| return new Promise((resolve, reject) => { | |
| axios({ | |
| method: "get", | |
| url, | |
| responseType: "stream", | |
| }).then((response) => { | |
| response.data.pipe(file) | |
| response.data.on("end", () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| struct ContentView: View { | |
| @State var query = "" | |
| var body: some View { | |
| NavigationView { | |
| ScrollView { | |
| LazyVStack { | |
| ForEach(0..<100, id: \.self) { n in | |
| HStack { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| enum Config { | |
| static let zoomRange: ClosedRange<CGFloat> = 0.05...1.0 | |
| } | |
| extension View { | |
| func zoomable(scale: Binding<CGFloat>) -> some View { | |
| ZoomableView(scale: scale) { | |
| self |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "ios": "react-native run-ios", | |
| "ios:iPad": "react-native run-ios --simulator=\"iPad Pro (11-inch) (3rd generation)\"", | |
| "ios:iPhone8": "react-native run-ios --simulator=\"iPhone 8 Plus\"", | |
| "ios:iPhone11": "react-native run-ios --simulator=\"iPhone 11 Pro Max\"" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <key>UISupportedInterfaceOrientations</key> | |
| <array> | |
| <string>UIInterfaceOrientationPortrait</string> | |
| </array> | |
| <key>UISupportedInterfaceOrientations~ipad</key> | |
| <array> | |
| <string>UIInterfaceOrientationPortrait</string> | |
| <string>UIInterfaceOrientationPortraitUpsideDown</string> | |
| <string>UIInterfaceOrientationLandscapeLeft</string> | |
| <string>UIInterfaceOrientationLandscapeRight</string> |