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
# ---------------------------------------------------------------- | |
# Makefile for building PostgreSQL | |
# | |
# Copyright(C) 2010 Satoshi Nagayasu <satoshi.nagayasu@gmail.com> | |
# ---------------------------------------------------------------- | |
PREFIX=/usr/local/pgsql90b1 | |
POSTGRES=postgresql-9.0beta1 | |
CONTRIBS=pgbench |
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
JSClass *Dog = [JSClass newClass:@"Dog" | |
parent:[NSObject class] | |
properties:[NSArray arrayWithObjects:@"name",@"breed",nil]]; | |
[Dog onClassMessage:@selector(dogWithBreed:) | |
do:^(id Self, NSString *breed) { | |
id instance = [[Self alloc] init]; | |
[instance setBreed:breed]; | |
return [instance autorelease]; | |
}]; | |
[Dog addClassProperty:@"kingdom" withValue:@"Animalia"]; |
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
// by Blain Hamon | |
var win = Ti.UI.createWindow({ | |
backgroundColor : 'white', | |
orientationModes : [Ti.UI.PORTRAIT] | |
}); | |
win.open(); | |
var label = Ti.UI.createLabel({ | |
text : 'No app event received. Make call while running app', | |
textAlign : 'center', |
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
// | |
// UIImage+Additions.h | |
// Sparrow | |
// | |
// Created by Shilo White on 10/16/11. | |
// Copyright 2011 Shilocity Productions. All rights reserved. | |
// | |
#define COLOR_PART_RED(color) (((color) >> 16) & 0xff) | |
#define COLOR_PART_GREEN(color) (((color) >> 8) & 0xff) |
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
// clang -W -Wall -Wno-unused-parameter -framework Foundation -fobjc-arc test.m | |
#import <Foundation/Foundation.h> | |
#define IDARRAY(...) ((id[]){ __VA_ARGS__ }) | |
#define IDCOUNT(...) (sizeof(IDARRAY(__VA_ARGS__)) / sizeof(id)) | |
typedef id (^Tuple)(int); |
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 | |
# Copyright (c) 2011 Float Mobile Learning | |
# http://www.floatlearning.com/ | |
# | |
# 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 |
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 <sys/xattr.h> | |
/// Set a flag that the files shouldn't be backuped to iCloud. | |
+ (void)addSkipBackupAttributeToFile:(NSString *)filePath { | |
u_int8_t b = 1; | |
setxattr([filePath fileSystemRepresentation], "com.apple.MobileBackup", &b, 1, 0, 0); | |
} | |
/// Returns the legacy storage path, used when the com.apple.MobileBackup file attribute is not available. | |
+ (NSString *)legacyStoragePath { |
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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
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
{ | |
NSURL *baseURL = [NSURL URLWithString:@"http://duckduckgo.com/"]; | |
NSDictionary *parameters = @{ @"q" : @"TWRequest -site:apple.com" }; | |
// With TWRequest: 1 line with **correct percent escaping** | |
NSURL *urlA = [[[[TWRequest alloc] initWithURL:baseURL parameters:parameters requestMethod:TWRequestMethodGET] signedURLRequest] URL]; | |
// Without TWRequest: 10 lines with wrong percent escaping (http://www.openradar.me/6546984) | |
NSMutableString *query = [NSMutableString string]; | |
for (NSString *key in parameters) |
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
// | |
// Created by Cédric Luthi on 2012-02-24. | |
// Copyright (c) 2012 Cédric Luthi. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
@interface NSData (Base64) | |
+ (id) dataWithBase64Encoding_xcd:(NSString *)base64String; |
OlderNewer