This file contains 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
#ifndef NS_DESIGNATED_INITIALIZER | |
#if __has_attribute(objc_designated_initializer) | |
#define NS_DESIGNATED_INITIALIZER __attribute((objc_designated_initializer)) | |
#else | |
#define NS_DESIGNATED_INITIALIZER | |
#endif | |
#endif |
This file contains 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 <UIKit/UIKit.h> | |
@interface RCDropdown : UITextField | |
@property (nonatomic) id<UIPickerViewDelegate> pickerDelegate; | |
@property (nonatomic) id<UIPickerViewDataSource> pickerDataSource; | |
@end |
This file contains 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
// | |
// NSAttributedString+RZExtensions.h | |
// Raizlabs | |
// | |
// Created by Alex Rouse on 12/13/13. | |
// Copyright 2014 Raizlabs and other contributors | |
// http://raizlabs.com/ | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining |
This file contains 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
# Tips from: http://xcodehelp.blogspot.ie/2012/05/add-version-number-to-settings-screen.html | |
# Reference from: https://developer.apple.com/library/mac/documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html | |
# Get the correct path for the git binary | |
git=`sh /etc/profile; which git` | |
# Save paths for the project and target Info.plist | |
projectPlistPath="${PROJECT_DIR}/${INFOPLIST_FILE}" | |
targetPlistPath="${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" |
This file contains 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
// | |
// KSDIdlingWindow.h | |
// | |
// Created by Brian King on 4/13/10. | |
// Copyright 2010 King Software Designs. All rights reserved. | |
// | |
// Based off: | |
// http://stackoverflow.com/questions/273450/iphone-detecting-user-inactivity-idle-time-since-last-screen-touch | |
// |
This file contains 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
#include <iostream> | |
#include <future> | |
using namespace std; | |
template <typename Fn, typename... Args> | |
auto do_async_with_log(ostream& os, Fn&& fn, Args&&... args) -> | |
future<decltype(fn(args...))> | |
{ | |
os << "[TID=" << this_thread::get_id() |
This file contains 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
xmlData = [[NSMutableData alloc] init]; | |
NSURL *url = [NSURL URLWithString: | |
@"http://forrums.bignerdranch.com/smartfeed.php?" | |
@"limit=NO_LIMIT&count_limit20&sort_by=standard&" | |
@"feed_type=RSS2.0&feed_style=COMPACT"]; | |
NSURLRequest *request = [NSURLRequest requestWithURL:url]; | |
//connection = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:YES]; | |
NSOperationQueue *queue = [[NSOperationQueue alloc]init]; | |
[NSURLConnection sendAsynchronousRequest:request | |
queue:queue |
This file contains 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
# compile | |
$ g++ zlib-example.cpp -lz -o zlib-example | |
# run | |
$ ./zlib-example | |
Uncompressed size is: 36 | |
Uncompressed string is: Hello Hello Hello Hello Hello Hello! | |
---------- |
This file contains 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
// (c) 2015 Nate Cook, licensed under the MIT license | |
// | |
// Initializers for Dictionary like NSDictionary +dictionaryWithObjects:forKeys: | |
public extension Dictionary { | |
/// Creates a new Dictionary from the given `keys` and `values` collections. | |
/// | |
/// More efficient than the sequence version because it can reserve the correct | |
/// capacity before filling the dictionary. Returns `nil` if the lengths of the | |
/// two collections differ. |
This file contains 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
// Swift Standard Librray - String | |
// ==== | |
// Initializing a String | |
// ==== | |
var emptyString = "" // Empty String | |
var stillEmpty = String() // Another empty String | |
let helloWorld = "Hello World!" // String inferred |
OlderNewer