- iTerm 2
- Oh My Zsh
- Powerline shell: path bars, edit config and remove username and hostname
- Meslo Powerline Font as you need a font that supports the directory characters for powerline
- Homebrew
- RVM
- Bundler
- direnv: Unclutter your .profile
- z: quickly jump between projects. Like Alfred but for your Terminal reduced to folder search only
echo "gem: --no-document" >> ~/.gemrc
to stop installing docs every time you install a gem
secrets/ |
The libdispatch is one of the most misused API due to the way it was presented to us when it was introduced and for many years after that, and due to the confusing documentation and API. This page is a compilation of important things to know if you're going to use this library. Many references are available at the end of this document pointing to comments from Apple's very own libdispatch maintainer (Pierre Habouzit).
My take-aways are:
-
You should create very few, long-lived, well-defined queues. These queues should be seen as execution contexts in your program (gui, background work, ...) that benefit from executing in parallel. An important thing to note is that if these queues are all active at once, you will get as many threads running. In most apps, you probably do not need to create more than 3 or 4 queues.
-
Go serial first, and as you find performance bottle necks, measure why, and if concurrency helps, apply with care, always validating under system pressure. Reuse
// Returns number of seconds passed between time when process was created and function was called | |
func measureAppStartUpTime() -> Double { | |
var kinfo = kinfo_proc() | |
var size = MemoryLayout<kinfo_proc>.stride | |
var mib : [Int32] = [CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid()] | |
sysctl(&mib, u_int(mib.count), &kinfo, &size, nil, 0) | |
let start_time = kinfo.kp_proc.p_starttime | |
var time : timeval = timeval(tv_sec: 0, tv_usec: 0) | |
gettimeofday(&time, nil) | |
let currentTimeMilliseconds = Double(Int64(time.tv_sec) * 1000) + Double(time.tv_usec) / 1000.0 |
extension JSONDecoder { | |
func decode<T: Decodable>(_ type: T.Type, from data: Data, keyedBy key: String?) throws -> T { | |
if let key = key { | |
// Pass the top level key to the decoder. | |
userInfo[.jsonDecoderRootKeyName] = key | |
let root = try decode(DecodableRoot<T>.self, from: data) | |
return root.value | |
} else { |
- Proposal: TBD
- Author: Evan Maloney
- Status: Draft
- Review manager: TBD
Frequently, closures are used as completion callbacks for asynchronous operations, such as when dealing with network requests. It is quite common to model these sorts of operations in such a way that an object instance represents a request/response transaction, for example:
#Every Single Option Under The Sun
- optimization level options
- automatic crashing options
- debug info options
- swift internal options
- swift debug/development internal options
- linker-specific options
- mode options
# | |
# If all files excluded and you will include only specific sub-directories | |
# the parent path must matched before. | |
# | |
/** | |
!/.gitignore | |
############################### | |
# Un-ignore the affected subdirectory |