Key repeat
defaults write -g InitialKeyRepeat -int 10 # normal minimum is 15 (225 ms)
defaults write -g KeyRepeat -int 1 # normal minimum is 2 (30 ms)
Requires restart.
defaults write -g InitialKeyRepeat -int 10 # normal minimum is 15 (225 ms)
defaults write -g KeyRepeat -int 1 # normal minimum is 2 (30 ms)
Requires restart.
How to setup a new Go project using Google Cloud Run and Cloud SQL.
$ gcloud components update
$ gcloud auth login
struct FlippedUpsideDown: ViewModifier { | |
func body(content: Content) -> some View { | |
content | |
.rotationEffect(.radians(.pi)) | |
.scaleEffect(x: -1, y: 1, anchor: .center) | |
} | |
} | |
extension View { | |
func flipUpsideDown() -> some View { |
import SwiftUI | |
import PanModal | |
struct ExampleView: View { | |
@State var detail: AnyView? = nil | |
@State var items: [String] = ["Detail 1", "Detail 2", "Detail 3"] | |
var body: some View { | |
NavigationView { |
InfoPlist.strings
fileUILaunchStoryboardName = "LaunchScreen";
// https://stackoverflow.com/questions/56716311/how-to-show-complete-list-when-keyboard-is-showing-up-in-swiftui?noredirect=1&lq=1 | |
import SwiftUI | |
import Combine | |
struct AdaptToKeyboard: ViewModifier { | |
@State var currentHeight: CGFloat = 0 | |
func body(content: Content) -> some View { |
import UIKit | |
import SwiftUI | |
import PlaygroundSupport | |
// CustomParentView is a custom UIKit view. Its Coordinator can be used | |
// to manage delegates if needed (e.g. UIContextMenuInteractionDelegate). | |
struct CustomParentView<Content: View>: UIViewRepresentable { | |
let content: UIView | |
// Based on the SuperMemo 2 Algorithm: | |
// https://www.supermemo.com/english/ol/sm2.htm | |
import UIKit | |
struct Item { | |
let id: UUID | |
let prompt: String | |
let explaination: String | |
var score: Score |
let task = URLSession.shared.dataTask(with: req) { (data, response, error) in | |
... | |
} | |
DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(4)) { | |
task.resume() | |
} |
*** Cluster Setup for Google Container Engine *** | |
0/ Install and configure local gcloud and kubectl: https://cloud.google.com/sdk/docs/ | |
> gcloud components install kubectl | |
1/ Configure Google Cloud account: | |
> gcloud config set account YOUR_EMAIL_ADDRESS | |
> gcloud config set project YOUR_PROJECT_ID | |
> gcloud config set compute/zone us-west1-a | |
> gcloud config set container/cluster example |