windows
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
<plist version="1.0"> | |
<dict> | |
<key>pings</key> | |
<array /> | |
<key>jingleDocType</key> | |
<string>purchaseSuccess</string> | |
<key>jingleAction</key> | |
<string>purchaseProduct</string> | |
<key>status</key> | |
<integer>0</integer> |
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 - AudioServicesPlaySystemSound | |
- (IBAction)shake0:(UIButton *)sender { | |
// `Peek` 震动反馈 (weak boom) | |
AudioServicesPlaySystemSound(1519); | |
} | |
- (IBAction)shake1:(UIButton *)sender { | |
// `Pop` 震动反馈 (strong boom) |
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
# encoding: US-ASCII | |
# stolen largely from http://www.ruby-forum.com/topic/140784 | |
require 'stringio' | |
require 'fileutils' | |
def extract_chunk(input, output) | |
lenword = input.read(4) | |
length = lenword.unpack('N')[0] | |
type = input.read(4) |
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
- (int)sinaCountWord:(NSString*)s | |
{ | |
int i,n=[s length],l=0,a=0,b=0; | |
unichar c; | |
for(i=0;i<n;i++){ | |
c=[s characterAtIndex:i]; | |
if(isblank(c)){ | |
b++; | |
}else if(isascii(c)){ | |
a++; |
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
Class LSApplicationWorkspace_class = objc_getClass("LSApplicationWorkspace"); | |
NSObject* workspace = [LSApplicationWorkspace_class performSelector:@selector(defaultWorkspace)]; | |
NSLog(@"openURL: %@",[workspace performSelector:@selector(applicationsAvailableForHandlingURLScheme:)withObject:@"XXX"]); |
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
//To get photos from camera roll use ALAssetsGroupSavedPhotos while enumerating assets library: | |
[library enumerateGroupsWithTypes:ALAssetsGroupSavedPhotos | |
usingBlock:enumerate | |
failureBlock:nil]; | |
//To detect what group you currently get: | |
if ([[group valueForProperty:@"ALAssetsGroupPropertyType"] intValue] == ALAssetsGroupSavedPhotos) | |
{ | |
NSLog(@"Camera roll"); |
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
xcodebuild -workspace {project name}.xcworkspace -scheme {project name} -arch i386 -sdk iphonesimulator7.1 |
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
# -*- coding: utf-8 -*- | |
"""将PNG图片用pngquant进行批量压缩 | |
安装: http://pngquant.org | |
""" | |
import os | |
import sys | |
import os.path | |
import subprocess |
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
MIME_TYPES = { | |
".123" => "application/vnd.lotus-1-2-3", | |
".3dml" => "text/vnd.in3d.3dml", | |
".3g2" => "video/3gpp2", | |
".3gp" => "video/3gpp", | |
".a" => "application/octet-stream", | |
".acc" => "application/vnd.americandynamics.acc", | |
".ace" => "application/x-ace-compressed", | |
".acu" => "application/vnd.acucobol", | |
".aep" => "application/vnd.audiograph", |
NewerOlder