# Spin up a beefy Digital Ocean droplet
doctl compute droplet create swift-dev --size m-224gb --image ubuntu-16-10-x64 --region sfo2 --ssh-keys XXXXXXX
doctl compute ssh swift-dev
# Install dependencies
apt-get update
apt-get install git cmake ninja-build clang python uuid-dev libicu-dev icu-devtools libbsd-dev libedit-dev libxml2-dev libsqlite3-dev swig libpython-dev libncurses5-dev pkg-config libblocksruntime-dev libcurl4-openssl-dev autoconf libtool systemtap-sdt-dev tzdata
# Clone & build Swift
import re | |
import __builtin__ | |
from itertools import islice | |
# See https://sourceware.org/gdb/current/onlinedocs/gdb/Convenience-Funs.html | |
# breakpoint command add -F '_caller_is("theCaller")' | |
# breakpoint command add -F 'not _caller_is("theCaller")' | |
def _caller_is(name): | |
def check(frame, loc, _): |
#!/bin/bash | |
# MIT License | |
# | |
# Copyright (c) 2018 Derek Selander (@LOLgrep) | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
As of iOS 11/macOS High Sierra, and only including ones in Foundation and CoreFoundation | |
Strings: | |
_NSCFString - a CFStringRef or CFMutableStringRef. This is the most common type of string object currently. | |
- May have 8 bit (ASCII) or 16 bit (UTF-16) backing store | |
_NSCFConstantString - a compile time constant CFStringRef, like you'd get with @"foo" | |
- May also be generated by dynamic string creation if matches a string in a pre-baked table of common strings called the StringROM | |
NSBigMutableString - an NSString backed by a CFStorage (https://github.com/opensource-apple/CF/blob/master/CFStorage.h) for faster handling of very large strings | |
NSCheapMutableString - a very limited NSMutableString that allows for zero-copy initialization. Used in NSFileManager for temporarily wrapping stack buffers. |
#!/bin/bash | |
# Exit the script immediately on error | |
set -e | |
# We'll work in /tmp | |
cd /tmp | |
# Clone mach_override unless we already have it | |
if [ ! -d mach_override ]; then |
You may want a linter plugin to lint your code in Vim but you probably don't need it. At least try the built-in way before jumping on the plugin bandwagon.
autocmd FileType <filetype> setlocal makeprg=<external command>
This autocommand tells Vim to use <external command>
when invoking :make %
in a <filetype>
buffer. You can add as many similar lines as needed for other languages.
Most people is familiar with Xcode theme support for the text editor. You simply open Preferences, Fonts & Colors and duplicate
an existing theme (or create a new one from scratch). Xcode editor themes have the .dvtcolortheme
extension.
However, there's some support for themeing Xcode itself (fonts, gradients, colors). Xcode loads the default theme from
/Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework/Versions/A/Resources/Default.dvttheme
.
.dvttheme
files are simply XML files that conform to an undocumented schema. If you want to modify any of the settings in
Default.dvttheme
, instead of modifying the bundle resource file you can instruct Xcode to load your custom .dvttheme
from
wherever you want:
TEAM_ID = 'XXXXXXXXXX' | |
APP_NAME = 'My App' | |
SCHEME_NAME = APP_NAME | |
desc 'Create a beta build' | |
task :build do | |
# Ensure clean git state | |
unless system 'git diff-index --quiet HEAD --' | |
abort 'Failed. You have uncommitted changes.' | |
end |
let badwork = { (queue: DispatchQueue) in | |
queue.async { | |
let app = UIApplication.shared | |
for index in 0..<100000 { | |
let name = "Yolo \(index)" | |
let identifier = app.beginBackgroundTask(withName: name, expirationHandler: { | |
print("Expired") | |
}); |