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
server { | |
listen 80; | |
server_name cbbank.comquas.com; | |
location / { | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_set_header X-NginX-Proxy true; | |
proxy_pass http://127.0.0.1:3001/; |
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 os | |
subDir = os.listdir(dirname) | |
#remove .DS_Store in mac osx | |
subDir = filter (lambda a: a != '.DS_Store', subDir) | |
#files name are Testing1.txt , Testing2.txt, Testing3.txt | |
toreplace = "Testing" | |
#x[0:len(toreplace)-1] is Testing |
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
This is ApacheBench, Version 2.3 <$Revision: 655654 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking localhost (be patient) | |
Server Software: Apache/2.2.22 | |
Server Hostname: localhost | |
Server Port: 80 |
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
python wp2tumblr.py -u [tumblr email address] -p [tumblr passwordd] -g [blog-url] -s [start-postnumber] wordpress-xml-export-path | |
-u require , tumblr email address | |
-p require , tumblr password | |
-g optional , tumblr blog url , default is current default tumblr url | |
-s Optional , default value is 0 | |
wordpress-xml-export-path Wordpress export XML file |
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
$ sudo vi /etc/php.ini |
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
#!/usr/bin/python | |
import sys, os, glob, commands, urllib2 | |
import PListReader, xml.sax | |
from optparse import OptionParser | |
temp_dir = "sdconv-temp" | |
script_module = { ".py": "python" } |
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
//need to use AVFoundation framework | |
/* | |
#import <AVFoundation/AVFoundation.h> | |
*/ | |
if(!self.flashOn) { | |
AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; | |
[device lockForConfiguration:nil]; |
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 DEBUG_MODE | |
#ifdef DEBUG_MODE | |
#define DLog( s, ... ) NSLog( @"<%@:(%d)> %@", [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] ) | |
#else | |
#define DLog( s, ... ) | |
#endif |
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
@implementation NSString (url) | |
-(NSString *)urlEncodedString { | |
return [(NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)self, NULL, CFSTR(":/?#[]@!$&’()*+,;="), kCFStringEncodingUTF8) autorelease]; | |
} | |
-(NSString *)urlDecodedString { | |
return [self stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; | |
} | |
@end |
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 | |
/** | |
* call back testing | |
* | |
* @return void | |
* @author saturngod | |
**/ | |
function callback_testing($callback) |