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 PostsController < ActionController::Base | |
def create | |
Post.create(post_params) | |
end | |
def update | |
Post.find(params[:id]).update_attributes!(post_params) | |
end | |
private |
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
#ifndef H_UTF8_MAPPED_UTF16_STRING_H_ | |
#define H_UTF8_MAPPED_UTF16_STRING_H_ | |
#import <Foundation/Foundation.h> | |
#import <string> | |
/* | |
* Convert a UTF-16 string to UTF-8, mapping indices to provide low-complexity | |
* range and index lookups. | |
* |
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
#import <Foundation/Foundation.h> | |
int main (int argc, const char * argv[]) | |
{ | |
#define kItemKey @"kItemKey" | |
#define kPriceKey @"kPriceKey" | |
@autoreleasepool { | |
// insert code here... |
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
#Xcode target has sub-targets of the resources bundle target, and the target that makes a universal version of the static library for the current build config). | |
#this is the Run Script build phase that happens after that. | |
echo "" | |
echo "moving resources bundle into universal build folder" | |
echo "" | |
if [ ${ACTION} = "build" ] | |
then | |
echo "Copying resources into ${BUILD_DIR}/${CONFIGURATION}-universal/ ..." |
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
#!/bin/sh | |
# makeuniversalstaticlib.sh | |
# SAMPLELib | |
# | |
#################[ Tests: helps workaround any future bugs in Xcode ]######## | |
DEBUG_THIS_SCRIPT="false" |
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
#import "AFRestClient+OAuth.h" | |
NSString * const kAFOAuthBasicGrantType = @"user_basic"; | |
NSString * const kAFOauthRefreshGrantType = @"refresh_token"; | |
@implementation AFRestClient (OAuth) | |
- (void)authenticateUsingOAuthWithPath:(NSString *)path | |
username:(NSString *)username | |
password:(NSString *)password |
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
de_CH: "CHF" (should be "Fr.") | |
fr_CH: "CHF" (should be "fr.") | |
it_CH: "CHF" (should be "fr.") | |
rm_CH: "CHF" (should be "fr.") | |
international: "USD" (should be "CHF") |
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
<key>CFBundleDocumentTypes</key> | |
<array> | |
<dict> | |
<key>CFBundleTypeName</key> | |
<string>All Files</string> | |
<key>LSItemContentTypes</key> | |
<array> | |
<string>public.data</string> | |
<string>public.content</string> | |
</array> |
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
// Accessorizer's default generated singleton code for class Foo | |
static Foo *sharedInstance = nil; | |
+ (void) initialize | |
{ | |
if (sharedInstance == nil) | |
sharedInstance = [[self alloc] init]; | |
} |
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
#import <Foundation/Foundation.h> | |
@interface NSDateComponents (HSINSDateUtils) | |
- (void) logToConsole; | |
@end |