Skip to content

Instantly share code, notes, and snippets.

View wonkwh's full-sized avatar
💭
I may be slow to respond.

wonkwh wonkwh

💭
I may be slow to respond.
View GitHub Profile
// dabb(dart apprentice beyond the basic> ch1 Challenges
void main() {
basicStringManipulationExercise1();
basicStringManipulationExercise2();
buildingStringsExercise();
stringValidationExercise();
challenge1();
challenge2();
}
// dabb ch1.
void main() {
/// Basic String Manipulation
changingCase();
trimming();
padding();
splittingAndJoining();
findAndReplace();
@wonkwh
wonkwh / README.md
Created November 17, 2023 04:36 — forked from brennanMKE/README.md
Key bindings for VS Code to work more like Xcode

The workbench in VS Code on the left has 5 buttons so cmd+1 through cmd+5 will select them.

Running the debugger is started with cmd+r and stopping the debugging is done with cmd+. just like Xcode.

FWIW: I (@Rondy) am not the author of the content presented here, which is an outline from Edmond Lau's book. I've just copy-pasted it from somewhere and saved as a personal gist, before it got popular on newsnews.ycombinator.com. I don't remember where exactly the original source is from and neither could find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

void main() {
List<String> sampleLists = [
'Angle',
'James',
'Won'
]
}

How to setup a practically free CDN

I've been using [Backblaze][bbz] for a while now as my online backup service. I have used a few others in the past. None were particularly satisfactory until Backblaze came along.

It was - still is - keenly priced at a flat $5 (£4) per month for unlimited backup (I've currently got just under half a terabyte backed-up). It has a fast, reliable client. The company itself is [transparent about their operations][trans] and [generous with their knowledge sharing][blog]. To me, this says they understand their customers well. I've never had reliability problems and everything about the outfit exudes a sense of simple, quick, solid quality. The service has even saved the day on a couple of occasions where I've lost files.

Safe to say, I'm a happy customer. If you're not already using Backblaze, [I highly recommend you do][recommend].

Taking on the big boys with B2

@wonkwh
wonkwh / BetterXcodeJumpToCounterpartSwift.org
Created June 3, 2020 06:49 — forked from danielmartin/BetterXcodeJumpToCounterpartSwift.org
Add support for a better Xcode's Jump to Next Counterpart in Swift

If you work on a Swift project that follows the Model-View-ViewModel (MVVM) architecture or similar, you may want to jump to counterpart in Xcode from your view to your model, and then to your view model. (ie. by using Ctrl+Cmd+Up and Ctrl+Cmd+Down).

You can do this in recent versions of Xcode by setting a configuration default.

From a terminal, just type this command and press Enter:

defaults write com.apple.dt.Xcode IDEAdditionalCounterpartSuffixes -array-add "ViewModel" "View"
struct CardHeading: View {
@State private var touchZoom: Bool = false
var body: some View {
VStack(spacing: 0) {
Image("banner")
.resizable()
.aspectRatio(contentMode: ContentMode.fill)
.frame(minWidth: 0, maxWidth: .infinity, maxHeight: 400)
.clipped()
//: Playground - noun: a place where people can play
import UIKit
import PlaygroundSupport
class Responder: NSObject {
@objc func segmentedControlValueChanged(_ sender: UISegmentedControl) {
UIView.animate(withDuration: 0.3) {
buttonBar.frame.origin.x = (segmentedControl.frame.width / CGFloat(segmentedControl.numberOfSegments)) * CGFloat(segmentedControl.selectedSegmentIndex)
}