jq is useful to slice, filter, map and transform structured json data.
brew install jq
| import SwiftUI | |
| let width : CGFloat = 82.0 | |
| let height : CGFloat = 82.0 | |
| struct ContentView: View { | |
| @State private var toggle = false | |
| var body: some View { | |
| VStack { | |
| Spacer() | |
| ZStack { | |
| Image(systemName: "heart.fill") |
| // by dave | |
| float[][] result; | |
| float t, c; | |
| float ease(float p) { | |
| p = c01(p); | |
| return 3*p*p - 2*p*p*p; | |
| } | |
| float ease(float p, float g) { |
| //------------------------------------------------------------------------ | |
| // Author: The SwiftUI Lab | |
| // Post: Advanced SwiftUI Animations - Part 4 | |
| // Link: https://swiftui-lab.com/swiftui-animations-part4 (TimelineView) | |
| // | |
| import SwiftUI | |
| struct CyclicTimelineSchedule: TimelineSchedule { | |
| let timeOffsets: [TimeInterval] |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| #!/usr/bin/ruby | |
| # Create display override file to force Mac OS X to use RGB mode for Display | |
| # see http://embdev.net/topic/284710 | |
| require 'base64' | |
| data=`ioreg -l -d0 -w 0 -r -c AppleDisplay` | |
| edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten | |
| vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten |
| import Foundation | |
| import SwiftUI | |
| struct GradientCircle: View { | |
| var body: some View { | |
| let color1 = Color.init(red: 81/255, green: 204/255, blue: 159/255) | |
| let color2 = Color.init(red: 154/255, green: 255/255, blue: 248/255) | |
| let spectrum = Gradient(colors: [ color1, color2]) | |
| let conic = | |
| LinearGradient(gradient: spectrum, startPoint: UnitPoint(x: 0, y: 0.5), endPoint: UnitPoint(x: 0.5, y: 1)) |
| //-------------------------------------------------- | |
| // The SwiftUI Lab: Advanced SwiftUI Animations | |
| // https://swiftui-lab.com/swiftui-animations-part1 | |
| //-------------------------------------------------- | |
| import SwiftUI | |
| struct ContentView: View { | |
| var body: some View { | |
| NavigationView { |
| import Foundation | |
| import UIKit | |
| struct ViewStyle<T> { | |
| let style: (T) -> Void | |
| } | |
| let filled = ViewStyle<UIButton> { | |
| $0.setTitleColor(.white, for: .normal) | |
| $0.backgroundColor = .red |