This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[nostalgia retain] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Run SwiftLint | |
START_DATE=$(date +"%s") | |
SWIFT_LINT=/usr/local/bin/swiftlint | |
SWIFT_FORMAT=/usr/local/bin/swiftformat | |
if [[ -e "${SWIFT_LINT}" ]]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Go clean | |
// Removes all the icons from your desktop and prevents you adding any | |
defaults write com.apple.finder CreateDesktop -bool false && killall Finder | |
// Go back to normal | |
defaults write com.apple.finder CreateDesktop -bool true && killall Finder |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ViewController: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
let observer = NumberGeneratorObserver() | |
observer.generatedNumber = { (number) in | |
print("Observed: \(number)") | |
} | |
let generator = NumberGenerator() | |
generator.addObserver(observer) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
f=$(pwd) | |
rm -rf Output | |
mkdir Output | |
# iTunes | |
sips --resampleWidth 1024 "${f}/${1}" --out "${f}/Output/iTunesArtwork.png" | |
# App |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSArray *myConstraints = [NSLayoutConstraint RCH_constraintsWithCompleteVisualFormat:@"H:|-60-[self]| * V:|[self]|" options:0 metrics:nil views:NSDictionaryOfVariableBindings(self, self.superview)]; | |
+ (NSArray *)RCH_constraintsWithCompleteVisualFormat:(NSString *)format options:(NSLayoutFormatOptions)opts metrics:(NSDictionary *)metrics views:(NSDictionary *)views | |
{ | |
NSMutableArray *constraints = [NSMutableArray arrayWithCapacity:0]; | |
NSArray *markers = @[@"H:", @"V:"]; | |
NSArray *parts = [format componentsSeparatedByString:@"*"]; | |
for (NSString *formatStringPart in parts) { | |
for (NSString *markerString in markers) { | |
NSInteger marker = [formatStringPart rangeOfString:markerString].location; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
File: KeychainItemWrapper.h | |
Abstract: | |
Objective-C wrapper for accessing a single keychain item. | |
Version: 1.2 - ARCified | |
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple | |
Inc. ("Apple") in consideration of your agreement to the following | |
terms, and your use, installation, modification or redistribution of |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
@interface Node : NSObject | |
@property (nonatomic) NSInteger identifier; | |
@property (nonatomic, copy) NSString *value; | |
+ (Node *)nodeWithIdentifier:(NSInteger)identifier value:(NSString *)value; | |
@end | |
@implementation Node | |
+ (Node *)nodeWithIdentifier:(NSInteger)identifier value:(NSString *)value { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# Command to empty Trash with 35-pass security method. This is the most secure deletion, | |
# so you will not be able to recover any file deleted with this method. | |
# Replace <MAC_USER> with your Mac username. | |
## | |
srm -rfv /Users/<MAC_USER>/.Trash/* | |
## | |
# Command to empty Trash with 7-pass security method that meets the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Download all assets from https://developer.apple.com/wwdc/videos | |
// Warning: might take up a lot of disk space | |
NodeList.prototype.toArray = function () { | |
return Array.prototype.slice.call(this); | |
}; | |
[].concat.apply([], document.querySelectorAll("li.session").toArray().map(function(session){ | |
var sessionID = session.id.match(/^\d+/)[0]; | |
var title = session.querySelector(".title").innerText; |
NewerOlder