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
# 1. Make sure you have nginx sub module compiled in | |
# nginx -V 2>&1 | grep --color=always '\-\-with\-http_sub_module' | |
# 2. add two directives below at HTTP level | |
# nginx.conf | |
http { | |
# ...... | |
sub_filter '</head>' '<style type="text/css">html{ filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); -webkit-filter: grayscale(100%); filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 10+, Firefox on Android */ |
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
<html> | |
<head> | |
<title>WebSocket Demo</title> | |
</head> | |
<style type="text/css"> | |
textarea{width:400px;height:150px;display:block;overflow-y:scroll;} | |
#output{width:600px;height:400px;background:whiteSmoke;padding:1em .5em;color:#000;border:none;} | |
button{padding:.2em 1em;} | |
</style> | |
<link href="layout.css" rel="stylesheet" type="text/css" /> |
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 MySharedThing | |
+ (id)sharedInstance | |
{ | |
DEFINE_SHARED_INSTANCE_USING_BLOCK(^{ | |
return [[self alloc] init]; | |
}); | |
} | |
@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
#import <CoreLocation/CoreLocation.h> | |
#import <ImageIO/ImageIO.h> | |
@interface CLLocation (EXIFGPS) | |
- (NSDictionary*) EXIFMetadataWithHeading:(CLHeading*)heading; | |
@end | |
@interface NSDate (EXIFGPS) |
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
var http = require('http'), | |
fs = require('fs'), | |
path = require('path'), | |
exec = require('child_process').exec; | |
function pipeDoc(inputPath, finalType, stream) { | |
var finalPath = path.dirname(inputPath) | |
+ "/" + path.basename(inputPath).split('.')[0] + ".html"; | |
var convCommand = 'unoconv -f ' + finalType + " " + inputPath; | |
exec(convCommand,function(err, stdout, stderr) { |
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 "MobClickOpenUDID+Swizzled.h" | |
#import <objc/message.h> | |
#import <JRSwizzle.h> // Swizzle 类方法,这样可以避免类去调用某些Apple可能不允许的方法,通过审核 | |
#import "YourDevice.h" // 你的设备相关类,用于生成自己的Device Unique ID | |
#import <RegExCategories.h> // 正则表达式 | |
#import <NSString+Ruby.h> // 字符串工具类 | |
static NSString * const kOpenUDIDKey = @"OpenUDID"; | |
static NSString * const kOpenUDIDSlotKey = @"OpenUDID_slot"; |
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 | |
# fix-xcode | |
# Rob Napier <robnapier@gmail.com> | |
# Script to link in all your old SDKs every time you upgrade Xcode | |
# Create a directory called /SDKs (or modify source_path). | |
# Under it, put all the platform directories: | |
# MacOSX.platform iPhoneOS.platform iPhoneSimulator.platform | |
# Under those, store the SDKs: |
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 | |
# This script automatically sets the version and short version string of | |
# an Xcode project from the Git repository containing the project. | |
# | |
# To use this script in Xcode, add the script's path to a "Run Script" build | |
# phase for your application target. | |
set -o errexit | |
set -o nounset |
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
var flow = webdriver.promise.controlFlow(); | |
var finish = function (done) { | |
driver.quit().then(function () { | |
done(); | |
}); | |
}; | |
var error = function (e) { | |
driver.quit().then(function () { |
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
// Add the following to your preferences file | |
"folder_exclude_patterns":[".git","node_modules"] |
OlderNewer