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.f. StackOverflow question/answer here: http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4 | |
# | |
# Version 2.3 | |
# | |
# Latest Change: | |
# - Apple's handling of "project files" is broken; added a workaround for Xcode 4.5 | |
# - Added automatic FAIL BUILD if any of the internal commands fail | |
# | |
# Purpose: |
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
#define SingletonWithBlock(block) static dispatch_once_t pred = 0; \ | |
__strong static id _sharedObject = nil; \ | |
dispatch_once(&pred, ^{ \ | |
_sharedObject = block(); \ | |
}); \ | |
return _sharedObject; \ | |
@implementation SingletonClass | |
+ (id)sharedInstance |
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 <CoreText/CoreText.h> | |
... | |
// preload | |
dispatch_queue_t queue = dispatch_queue_create("com.company.worker", NULL); | |
dispatch_async(queue, ^(void) { | |
NSMutableDictionary *attributes = [NSMutableDictionary dictionary]; | |
[attributes setObject:@"Helvetica" forKey:(id)kCTFontFamilyNameAttribute]; | |
[attributes setObject:[NSNumber numberWithFloat:36.0f] forKey:(id)kCTFontSizeAttribute]; |
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
/* The API controller | |
Exports 3 methods: | |
* post - Creates a new thread | |
* list - Returns a list of threads | |
* show - Displays a thread and its posts | |
*/ | |
var Thread = require('../models/thread.js'); | |
var Post = require('../models/post.js'); |
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
#!/bin/bash | |
## Nodejs custom version installer | |
## | |
## Ronaldo Barbachano April 2013 | |
## Based on the openshift/nodejscustom-version-openshift repo | |
## | |
## Supply with path to existing openshift repo, or move script into | |
## repo root. | |
## | |
## Probably less headaches if this is run immediately after |
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
# 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) |
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
package com.example.testSingleton; | |
import android.app.Activity; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.widget.Toast; | |
public class ActivityA extends Activity { | |
@Override | |
public void onCreate(Bundle savedInstanceState) { |
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
find . -name "*.m" | xargs genstrings |
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
package com.example.testSingleton; | |
import android.app.Activity; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.widget.Toast; | |
public class ActivityA extends Activity { | |
@Override | |
public void onCreate(Bundle savedInstanceState) { |
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
// | |
// GIFDownloader.h | |
// TheJoysOfCode | |
// | |
// Created by Bob on 29/10/12. | |
// Copyright (c) 2012 Tall Developments. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
OlderNewer