sudo mkdir /private/tmp
sudo chmod 1777 /private/tmp
xcrun
xcrun simctl list devices //to list all simulators
xcrun simctl delete // to delete specific device
| Regex for matching ALL Japanese common & uncommon Kanji (4e00 – 9fcf) ~ The Big Kahuna! | |
| ([一-龯]) | |
| Regex for matching Hirgana or Katakana | |
| ([ぁ-んァ-ン]) | |
| Regex for matching Non-Hirgana or Non-Katakana | |
| ([^ぁ-んァ-ン]) | |
| Regex for matching Hirgana or Katakana or basic punctuation (、。’) |
Author: https://www.cyanhall.com/
Core Animation's original name is Layer Kit
Core Animation is a compositing engine; its job is to compose different pieces of visual content on the screen, and to do so as fast as possible. The content in question is divided into individual layers stored in a hierarchy known as the layer tree. This tree forms the underpinning for all of UIKit, and for everything that you see on the screen in an iOS application.
In UIView, tasks such as rendering, layout and animation are all managed by a Core Animation class called CALayer. The only major feature of UIView that isn’t handled by CALayer is user interaction.
There are four hierarchies, each performing a different role:
(Serial port or com port? - Serial ports are often refered as COM ports. It is the same to be short. You can read abut it in the Wiki article )
| print(String(data: try! JSONSerialization.data(withJSONObject: dict, options: .prettyPrinted), encoding: .utf8)!) |
brew cask install ngrokThe easiest way to use ngrok to tunnel into your localhost is if your local project is running on a specific port (e.g. not using named vhosts). You just run ngrok http [port number].
You can quickly boot up a local webserver using ruby. cd into the project's root directory and run ruby -run -e httpd . -p [port number].
| var net = require('net'); | |
| // creates the server | |
| var server = net.createServer(); | |
| //emitted when server closes ...not emitted until all connections closes. | |
| server.on('close',function(){ | |
| console.log('Server closed !'); | |
| }); |
| class EventEmitter | |
| /// Shared Instance. | |
| public static var sharedInstance = EventEmitter() | |
| // ReactNativeEventEmitter is instantiated by React Native with the bridge. | |
| private static var eventEmitter: ReactNativeEventEmitter! | |
| private init() {} |
| git cherry-pick <commit> |
| #!/usr/bin/env xcrun --sdk macosx swift | |
| import Foundation | |
| fileprivate extension Array { | |
| func separate(where condition: (Element) -> Bool) -> ([Element], [Element]) { | |
| return self.reduce( ([Element](), [Element]()) ) { (result, nextElement) -> ([Element], [Element]) in | |
| if condition(nextElement) { | |
| return (result.0 + [nextElement], result.1) | |
| } |