Moved to github.com/rafi/notebook
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
SIMULATOR_LIBRARY_PATH="${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/lib${PROJECT_NAME}.a" && | |
DEVICE_LIBRARY_PATH="${BUILD_DIR}/${CONFIGURATION}-iphoneos/lib${PROJECT_NAME}.a" && | |
UNIVERSAL_LIBRARY_DIR="${BUILD_DIR}/${CONFIGURATION}-iphoneuniversal" && | |
UNIVERSAL_LIBRARY_PATH="${UNIVERSAL_LIBRARY_DIR}/${PRODUCT_NAME}" && | |
FRAMEWORK="${UNIVERSAL_LIBRARY_DIR}/${PRODUCT_NAME}.framework" && | |
# Create framework directory structure. | |
rm -rf "${FRAMEWORK}" && | |
mkdir -p "${UNIVERSAL_LIBRARY_DIR}" && | |
mkdir -p "${FRAMEWORK}/Versions/A/Headers" && |
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
- (void) keyboardWillHide:(NSNotification *)nsNotification { | |
NSDictionary * userInfo = [nsNotification userInfo]; | |
CGSize kbSize = [[userInfo objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size; | |
CGRect newFrame = [tableframe]; | |
CGFloat kHeight = kbSize.height; | |
if(UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)){ |
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 <stdio.h> | |
/** | |
This only works if the block in question is called synchronously. | |
*/ | |
void try0() { | |
typedef void(^RecursiveBlock)(); | |
__block int i = 5; |
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
*.strings utf16 diff=localizablestrings |
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
func switchRootViewController(rootViewController: UIViewController, animated: Bool, completion: (() -> Void)?) { | |
if animated { | |
UIView.transitionWithView(window, duration: 0.5, options: .TransitionCrossDissolve, animations: { | |
let oldState: Bool = UIView.areAnimationsEnabled() | |
UIView.setAnimationsEnabled(false) | |
self.window!.rootViewController = rootViewController | |
UIView.setAnimationsEnabled(oldState) | |
}, completion: { (finished: Bool) -> () in | |
if completion { | |
completion!() |
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
# This script is based on Jacob Van Order's answer on apple dev forums https://devforums.apple.com/message/971277 | |
# See also http://spin.atomicobject.com/2011/12/13/building-a-universal-framework-for-ios/ for the start | |
# To get this to work with a Xcode 6 Cocoa Touch Framework, create Framework | |
# Then create a new Aggregate Target. Throw this script into a Build Script Phrase on the Aggregate | |
###################### | |
# Options |
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
Copyright 2015 Chris Eidhof | |
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 copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHE |
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
// | |
// MKMapViewExtension.swift | |
// AutocompleteTextfieldSwift | |
// | |
// Created by Mylene Bayan on 2/22/15. | |
// Copyright (c) 2015 MaiLin. All rights reserved. | |
// | |
import Foundation | |
import MapKit |
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
var CryptoJS = require('crypto-js'); | |
function uploadImage(uri) { | |
let timestamp = (Date.now() / 1000 | 0).toString(); | |
let api_key = 'your api key' | |
let api_secret = 'your api secret' | |
let cloud = 'your cloud name' | |
let hash_string = 'timestamp=' + timestamp + api_secret | |
let signature = CryptoJS.SHA1(hash_string).toString(); | |
let upload_url = 'https://api.cloudinary.com/v1_1/' + cloud + '/image/upload' |
OlderNewer