- Introduction
- Definition
- Examples
- Links
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
NSURLConnection | NSURLSession | |
------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------- | |
NSURLConnectionDelegate connectionShouldUseCredentialStorage: | | |
------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------- | |
NSURLConnectionDelegate connection:willSendRequestForAuthenticationChallenge: | NSURLSessionDelegate URLSession:didReceiveChallenge:completionHandler: | |
| N |
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
/* | |
* This is an example provided by Facebook are for non-commercial testing and | |
* evaluation purposes only. | |
* | |
* Facebook reserves all rights not expressly granted. | |
* | |
* 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 NON INFRINGEMENT. IN NO EVENT SHALL | |
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
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
String strSDCardPath = System.getenv("SECONDARY_STORAGE"); | |
if ((null == strSDCardPath) || (strSDCardPath.length() == 0)) { | |
strSDCardPath = System.getenv("EXTERNAL_SDCARD_STORAGE"); | |
} | |
try { | |
// Open the file | |
FileInputStream fs = new FileInputStream("/proc/mounts"); | |
DataInputStream in = new DataInputStream(fs); |
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
UIImage *originalImage = [UIImage imageNamed:@"myiconname"]; | |
UIImage *tintedImage = [originalImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; | |
UIImageView *imageView = [[UIImageView alloc] initWithImage:tintedImage]; | |
imageView.tintColor = [UIColor redColor]; | |
imageView.frame = CGRectMake(?, ?, ?, ?); | |
[self.view addSubview:imageView]; |
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
open `find . -name '*.xcodeproj' -prune -o -name '*.xcworkspace' -print` |
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
# put this into your config/eydeploy.rb | |
def bundle | |
if File.exist?("#{c.release_path}/Gemfile") | |
info "~> Gemfile detected, bundling gems" | |
lockfile = File.join(c.release_path, "Gemfile.lock") | |
bundler_installer = if File.exist?(lockfile) | |
get_bundler_installer(lockfile) | |
else | |
warn_about_missing_lockfile |
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
\d list dbs | |
\c 'mydatabase' | |
\d -> list tables | |
\d 'table' |
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 App < Sinatra::Base | |
configure :development do | |
set :raise_errors, true | |
#when set to true display a nice exception page for dev but prevent exception handler from working | |
set :show_exceptions, false | |
end | |
get '/someroute' do | |
MyModel.might_generate_an_exception |
NewerOlder