Definitely not comprehensive. This is meant to be a basic memory aid with links to get more details. I'll add to it over time.
$ npm install mongoose --save
const mongoose = require('mongoose');
import React, { Component } from 'react'; | |
import { Text } from 'react-native'; | |
import { DrawerNavigator } from 'react-navigation'; | |
const ContentScreen = ({ navigation }) => ( | |
<Text>Content Hello World</Text> | |
); | |
const LeftDrawerScreen = ({ navigation }) => ( | |
<Text>Left Drawer</Text> |
<?php | |
// Matches with 'weather + anything' | |
$bot->answer('weather%', function ($bot, $user_id, $input) | |
{ | |
$city = ltrim($input, 'weather'); | |
// Pseudo code to get weather from database | |
$weather = DB::getWeather($city); | |
// based on : http://stackoverflow.com/questions/24752627/accessing-ios-address-book-with-swift-array-count-of-zero | |
// http://stackoverflow.com/questions/24752627/accessing-ios-address-book-with-swift-array-count-of-zero | |
class func extractABAddressBookRef(abRef: Unmanaged<ABAddressBookRef>!) -> ABAddressBookRef? { | |
if let ab = abRef { | |
return Unmanaged<NSObject>.fromOpaque(ab.toOpaque()).takeUnretainedValue() | |
} | |
return nil | |
} |
- (BOOL)openTwitterClientForUserName:(NSString*)userName { | |
NSArray *urls = [NSArray arrayWithObjects: | |
@"twitter:@{username}", // Twitter | |
@"tweetbot:///user_profile/{username}", // TweetBot | |
@"echofon:///user_timeline?{username}", // Echofon | |
@"twit:///user?screen_name={username}", // Twittelator Pro | |
@"x-seesmic://twitter_profile?twitter_screen_name={username}", // Seesmic | |
@"x-birdfeed://user?screen_name={username}", // Birdfeed | |
@"tweetings:///user?screen_name={username}", // Tweetings | |
@"simplytweet:?link=http://twitter.com/{username}", // SimplyTweet |
#import <UIKit/UIKit.h> | |
@interface UILabel (ContentSize) | |
- (CGSize)contentSize; | |
@end |
Read the blog at http://fokkezb.nl/2013/09/20/url-schemes-for-ios-and-android-2/
/* | |
Before: | |
CGRect frame = myView.frame; | |
frame.origin.x = newX; | |
myView.frame = frame; | |
After: | |
myView.x = newX; | |
# xcode-build-bump.sh | |
# @desc Auto-increment the build number every time the project is run. | |
# @usage | |
# 1. Select: your Target in Xcode | |
# 2. Select: Build Phases Tab | |
# 3. Select: Add Build Phase -> Add Run Script | |
# 4. Paste code below in to new "Run Script" section | |
# 5. Drag the "Run Script" below "Link Binaries With Libraries" | |
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0) |
<?php | |
//How to use it | |
//Just call timthumb.php with appropriate arguments, For example: | |
<img src="/script/timthumb.php?src=/some/path/myimage.png&w=100&h=80" alt="resized image" /> | |
/* http://viralpatel.net/blogs/resize-image-dynamically-php/ */ | |
?> |