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 show = false | |
| @State var height: CGFloat = 250 | |
| var body: some View { | |
| List { | |
| Button("Pop Sheet") { | |
| height = 250 | |
| show.toggle() |
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
| // 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks. | |
| // You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/) | |
| (() => { | |
| const SHOW_SIDES = false; // color sides of DOM nodes? | |
| const COLOR_SURFACE = true; // color tops of DOM nodes? | |
| const COLOR_RANDOM = false; // randomise color? | |
| const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com) | |
| const MAX_ROTATION = 180; // set to 360 to rotate all the way round | |
| const THICKNESS = 20; // thickness of layers | |
| const DISTANCE = 10000; // ¯\\_(ツ)_/¯ |
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 { useLoaderData, Link, useSearchParams } from 'remix'; | |
| import { parseISO, format } from 'date-fns'; | |
| import groupBy from 'lodash/groupBy'; | |
| let PAGE_SIZE = 5; | |
| function safeParseInt(str) { | |
| let parsed = parseInt(str); | |
| return isNaN(parsed) ? 0 : parsed; | |
| } |
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 | |
| extension View { | |
| func wiggling() -> some View { | |
| modifier(WiggleModifier()) | |
| } | |
| } | |
| struct WiggleModifier: ViewModifier { | |
| @State private var isWiggling = false |
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
| { | |
| "name": "remove-ts", | |
| "version": "1.0.0", | |
| "description": "I use this to automatically fix feedback links in my workshops", | |
| "bin": "./remove-ts.js", | |
| "dependencies": { | |
| "@babel/core": "7.13.8", | |
| "@babel/preset-typescript": "7.13.0", | |
| "glob": "7.1.6" | |
| } |
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 {useEffect} from 'react' | |
| import {RecoilRoot, useRecoilState, atom} from 'recoil' | |
| // User data | |
| const user1 = {username: 'joe', bio: "You will never see me, unless of course this example is totally broken."} | |
| const user2 = {username: 'bob', bio: "I am the one true user."} | |
| const user3 = {username: 'fred', bio: "Just kidding, make way for the new guy."} | |
| // Recoil atom to store user. The default user is user1, but it will be |
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
| <dialog open> | |
| <form method="dialog"> | |
| <p>Do you want to confirm your action?</p> | |
| <div class="right"> | |
| <input class="btn" type="submit" value="Ok" /> | |
| <input class ="btn" type="submit" value="Cancel" /> | |
| </div> | |
| </form> | |
| </dialog> |
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 PaymentRing: View { | |
| @State var frameSize = UIScreen.main.bounds.width - 120 | |
| @State var current: CGFloat = 0 | |
| @State var value: Double = 0 | |
| var body: some View { | |
| VStack { | |
| ZStack { | |
| Circle().stroke(Color.secondary, style: StrokeStyle(lineWidth: 40, lineCap: .butt, lineJoin: .round)).frame(width: frameSize, height: frameSize) |
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
| // | |
| // ContentView.swift | |
| // Widgets | |
| // | |
| // Created by Kyle Halevi on 7/3/20. | |
| // | |
| import SwiftUI | |
| struct Widget: View { |
NewerOlder