This file contains hidden or 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
function doesAppExist() { | |
// try to open iOS application | |
document.location = 'customiosappurl://'; | |
// if above failed, nothing happened | |
// set a timeout and do something else | |
!window.document.webkitHidden && setTimeout(function() { | |
setTimeout(function() { | |
window.location = '//apple.itunes.com/whatever' | |
}, 100); |
This file contains hidden or 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.To find which library is using uniqueidentifier method, go to your project folder and type in: | |
$ find . | grep -v .svn | grep "\.a" | grep -v "\.app" | xargs grep uniqueIdentifier |
This file contains hidden or 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 - 新浪微博mid与url互转 | |
-(NSArray*)str62keys | |
{ | |
return @[@"0",@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9", | |
@"a",@"b",@"c",@"d",@"e",@"f",@"g",@"h",@"i",@"j",@"k",@"l",@"m",@"n",@"o",@"p",@"q",@"r",@"s",@"t",@"u",@"v",@"w",@"x",@"y",@"z", | |
@"A",@"B",@"C",@"D",@"E",@"F",@"G",@"H",@"I",@"J",@"K",@"L",@"M",@"N",@"O",@"P",@"Q",@"R",@"S",@"T",@"U",@"V",@"W",@"X",@"Y",@"Z"]; | |
} | |
/** | |
* 62进制值转换为10进制 | |
* @param {NSString} str62 62进制值 |
This file contains hidden or 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
// | |
// Regular Expression for URL validation | |
// | |
// Author: Diego Perini | |
// Updated: 2010/12/05 | |
// License: MIT | |
// | |
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it) | |
// | |
// Permission is hereby granted, free of charge, to any person |
This file contains hidden or 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
Basically, UIPasteBoard allows us to share data to other application. Below is an example of UIpasteBoard usage. | |
COPY | |
UIPasteboard *appPasteBoard = [UIPasteboard generalPasteboard]; | |
appPasteBoard.persistent = YES; | |
[appPasteBoard setString:@"STRING TO COPY"]; | |
PASTE |
This file contains hidden or 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/env bash | |
# Derived from: https://gist.github.com/RichardBronosky/2878446 | |
realpath(){ | |
echo "$(cd "$(dirname "$1")"; echo -n "$(pwd)/$(basename "$1")")"; | |
} | |
IPA_SRC="$(realpath $1)" | |
PROVISIONING_PROFILE="$(realpath $2)" |
This file contains hidden or 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/env python | |
# Taken from http://zulko.github.io/blog/2015/02/01/extracting-perfectly-looping-gifs-from-videos-with-python-and-moviepy/ | |
import os | |
import sys | |
import moviepy.editor as mp | |
from moviepy.video.tools.cuts import FramesMatches | |
if len(sys.argv) != 2: |
This file contains hidden or 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
#Get the current configuration and save it locally | |
curl -X GET http://user:[email protected]/job/myjobname/config.xml -o mylocalconfig.xml | |
#Update the configuration via posting a local configuration file | |
curl -X POST http://user:[email protected]/job/myjobname/config.xml --data-binary "@mymodifiedlocalconfig.xml" | |
#Creating a new job via posting a local configuration file | |
curl -X POST "http://user:[email protected]/createItem?name=newjobname" --data-binary "@newconfig.xml" -H "Content-Type: text/xml" |
This file contains hidden or 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
[{ | |
"trigger": { | |
"url-filter": "sitecatalyst.js" | |
}, | |
"action": { | |
"type": "block" | |
} | |
}, { | |
"trigger": { | |
"url-filter": "twitter.com/widgets.js" |