QEMU on macOS Install QEMU first (e.g. using Homebrew): $ brew install qemu Launch script based on GCW Zero’s one (removed SDL and audio set to none). It should mount ./sdcard folder as /media...
Using Grep to find files
The grep utility can be used to find files contains occurrences of the given pattern. $ man grep Add colors There is an option to have matching text to be marked up. It’s nice to have it each t...
Using system clipboard in Vim on macOS
Using system clipboard in Vim on macOS When you do copy, cut and paste text in Vim it goes into Vim’s own buffer (register). Actually it has many registers, but we are’re interested only in primar...
CALayer Animations
Create custom progress view using CALayer and CoreAnimation. Start with base class and protocols. Our base class should have progress property marked as @NSManaged to work with CoreAnimation. Al...
Using Mixins in Swift
Mixin — it is a protocol with default implementation of methods. Let’s say we have a registration screen with email input text field that needs to be validated to be sure it is correct email add...
String pattern matching in Swift
Our goal is to use string pattern matching in easy-swifty way: // Credit card number let string = "4916474932438684" // Check if it's Visa if string =~ "^4[0-9]{6,}$" { /* */ } Pattern ma...
Extensions in Swift
Extensions in Swift allow us to add methods to existing objects (class, struct, enum and protocol). They are similar to categories in Objective-C. Let’s extend UIColor class with custom convenienc...
Command, option and shift in Unicode
Unicode macOS symbols list: ⌘ – ⌘ – ⌘ – Command Key ⌥ – ⌥ – ⌥ – Option Key ⇧ – ⇧ – ⇧ – Shift Key ⎋ – ⎋ – &#90...
Как поменять память в MacBook Pro
Сегодня наконец-то поменял память в своем MacBook Pro. Расскажу немного как это сделать самостоятельно. Для начала разберем наш ноутбук. Выключаем ноутбук. Отсоединяем все кабели. Ничего не должно ...