// Work-in-progress // script to install jekyll on ZSH.
Installation reference on MacOS Catalina running ZSH shell
which ruby
which gem
// -------------------------------------------------------------------------------------- | |
// How To Use Geometry Reader to Access Device Dimensions in SwiftUI | |
// -------------------------------------------------------------------------------------- | |
// Wrap the view code you wish to measure using the GeometryReader closure. | |
// Using "device" will provide the most clarity to measuring device view dimensions. | |
// Access the parent view's dimensions using "device.size.width" or "device.size.height" | |
// Official Docs: https://developer.apple.com/documentation/swiftui/geometryreader | |
// | |
// Orientation.swift | |
// Code Template | |
// | |
// Created by Pao Yu on 2020-04-18. | |
// Copyright © 2020 Yu Pao. All rights reserved. | |
// | |
import SwiftUI |
import SwiftUI | |
struct Motion { | |
let motionEffectGroup: UIMotionEffectGroup = { | |
let xMotion: UIInterpolatingMotionEffect = { | |
let min = CGFloat(-30) | |
let max = CGFloat(30) | |
let xMotionSetting = UIInterpolatingMotionEffect(keyPath: "layer.transform.translation.x", type: .tiltAlongHorizontalAxis) |
import SwiftUI | |
import AVFoundation | |
class Sound { | |
var audioPlayer: AVAudioPlayer? | |
func soundSetup() { | |
do { | |
try AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.ambient) |
import SwiftUI | |
class DeviceSize { | |
var scale: [CGFloat] { | |
var silverRatioArray: [CGFloat] = [0] | |
for i in 0 ... 21 { | |
if i > 1 { | |
silverArray[i] = silverArray[i - 1] * (1 + sqrt(2)) | |
} else { |
echo "Initialize $0 script..." | |
git add . | |
git commit -m "$1" | |
git push -u origin master | |
git log --oneline | |
echo "$0 successful." | |
echo "--------------------------------" | |
# -------------------------------- | |
# Usage on MacOS |
void setup() { | |
pinMode(13, OUTPUT); | |
} | |
// the loop function runs over and over again forever | |
void loop() { | |
delay(500); | |
blink(); | |
delay(500); | |
blink(); |
int pin1Led = 4; | |
int pin2Led = 5; | |
void setup() { | |
pinMode(pin1Led, OUTPUT); | |
pinMode(pin2Led, OUTPUT); | |
} | |
void loop() { | |
setLed(HIGH, LOW); |
const int ledCount = 10; | |
int ledPins[] = { 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }; | |
void setup() { | |
for (int i = 0; i < ledCount; i++) { | |
pinMode(ledPins[i], OUTPUT); | |
} | |
} | |
void loop() { |