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
######################### | |
# .gitignore file for Xcode5 | |
# | |
# NB: if you are storing "built" products, this WILL NOT WORK, | |
# and you should use a different .gitignore (or none at all) | |
# This file is for SOURCE projects, where there are many extra | |
# files that we want to exclude | |
# | |
# For updates, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects | |
# and https://gist.github.com/adamgit/3786883 |
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
// | |
// GTMBase64.h | |
// | |
// Copyright 2006-2008 Google Inc. | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); you may not | |
// use this file except in compliance with the License. You may obtain a copy | |
// of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.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
#import <Foundation/Foundation.h> | |
@interface DeviceIdentifier : NSObject | |
/** | |
* @brief use this method when you need a unique identifier in one app. | |
* It generates a hash from the MAC-address in combination with the bundle identifier of your app. | |
* |
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 <Foundation/Foundation.h> | |
@interface MD5 : NSObject | |
/** | |
* @brief calculate a message-digest fingerprint for a input string. | |
* | |
* @return return a message-digest fingerprint | |
*/ | |
+ (NSString *)MD5String:(NSString *)string; |
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 <CFByteOrder.h> | |
// Bytes to uint32_t | |
NSData *data = <THE_DATA>; | |
void *bytes = [data bytes]; | |
uint32_t *intBytes = (NSInteger*)bytes; | |
uint32_t swapped = CFSwapInt32BigToHost(*intBytes); ///< If the data in `data' is big endian | |
// uint32_t to bytes | |
uint32_t someInt = 1234; |
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
#pragma mark - NSURLConnection methods | |
/* | |
- (BOOL)connectionShouldUseCredentialStorage:(NSURLConnection *)connection { | |
return NO; | |
} | |
*/ | |
- (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace { | |
//NSLog(@"can auth"); |
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
//尚译bookmarklet 压缩 | |
javascript:void((function(){if(window.Como&&window.Como.someyi){Como.someyi.open()}else{var%20a=document.createElement('script');a.setAttribute('type','text/javascript');var%20b=document.charset?document.charset:document.characterSet;var%20c=b.toLowerCase()=='gb2312'?'pack-gb2312.js':'pack-utf8.js';a.setAttribute('src','http://bcs.duapp.com/shangyi12345/'+c);document.getElementsByTagName('head').item(0).appendChild(a);Text.prototype.tagName='#text'}})()) | |
//尚译bookmarklet 未压缩 | |
javascript: void((function () { | |
if (window.Como && window.Como.someyi) { | |
Como.someyi.open() | |
} else { | |
var a = document.createElement('script'); | |
a.setAttribute('type', 'text/javascript'); |
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
<?php | |
define("THREADS",1); | |
define("DAEMON","/usr/local/bin/daemon"); | |
define("SCRIPT","/****/worker.php"); | |
define("CHDIR","/****/"); | |
define("NAME_PREFIX","worker"); | |
define("PHP_CLI","/usr/local/php/bin/php"); | |
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
#删除git submodule | |
git rm --cached /path/to/source |
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
/** | |
* @doc http://fuelphp.com/docs/classes/mongo/methods.html | |
* has changed by remove profiling setting | |
* | |
* sample config | |
* 'mongodb' => array( | |
* 'hostname' => 'localhost', | |
* 'database' => 'database', | |
* 'username' => 'admin', | |
* 'password' => 'admin', |