CLICK ME
yes, even hidden code blocks!
print("hello world!")
public extension Collection { | |
func keyedBy<T>(_ keyer: (Iterator.Element) -> T?) -> Dictionary<T, Iterator.Element> { | |
var d = Dictionary<T, Iterator.Element>() | |
for item in self { | |
if let key = keyer(item) { | |
d[key] = item | |
} | |
} | |
return d |
### Keybase proof | |
I hereby claim: | |
* I am davedelong on github. | |
* I am davedelong (https://keybase.io/davedelong) on keybase. | |
* I have a public key ASBPhXPG-DfGDYTWePezV32Zhv_iOJVF2cqJVVvmtzdCHQo | |
To claim this, I am signing this object: |
#!/usr/bin/swift | |
import Foundation | |
func scanForRepositories(directory: NSURL, root: NSURL) { | |
let fileManager = NSFileManager.defaultManager() | |
let options: NSDirectoryEnumerationOptions = .SkipsSubdirectoryDescendants | .SkipsPackageDescendants | |
if let contents = fileManager.contentsOfDirectoryAtURL(directory, includingPropertiesForKeys: [NSURLIsDirectoryKey], options: options, error: nil) { | |
let urls = contents as Array<NSURL> |
#!/bin/bash | |
# A script to automatically switch to another user in macOS | |
# Invoke like this: `autologin.sh {user} {password}` | |
uid=`id -u $1` | |
/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -switchToUserID "$uid" | |
osascript <<EOD |
mdfind "kMDItemAppStoreIsAppleSigned !=1 && kMDItemContentType = \"com.apple.application-bundle\" && kMDItemCFBundleIdentifier != "com.apple.*"" -onlyin /Applications |
int main(int argc, const char * argv[]) { | |
@autoreleasepool { | |
NSString *str = @"Base64 is a group of similar binary-to-text encoding schemes that represent binary data in an ASCII string format by translating it into a radix-64 representation. The term Base64 originates from a specific MIME content transfer encoding."; | |
NSData *data = [str dataUsingEncoding:NSUTF8StringEncoding]; | |
char table[] = { | |
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', | |
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', |
__block void(^block)(int) = ^(int i) { | |
printf("%d", i); | |
if (i > 0) { | |
block(i-1); | |
} else { | |
block = nil; | |
} | |
}; | |
block(9); |
xlog = log --graph --pretty=format:\"%C(yellow)%h%Creset %ad %s%C(cyan)%d%Creset %C(green)[%an]%Creset\" --date=short |
- All Creatures Great & Small | |
- Alphas | |
- Arrested Development | |
+ Avatar: the Last Airbender | |
- Babylon 5 | |
+ Battlestar Galactica | |
- Big Bang Theory | |
+ Caprica | |
+ Castle | |
- Continuum |