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
// http://stackoverflow.com/a/3346157/490794 | |
// call | |
NSMutableDictionary *myDict; | |
[object performSelectorOnMainThread:@selector(getElements:) | |
withObject:&myDict waitUntilDone:YES]; | |
// define | |
- (void)getElements:(NSMutableDictionary **)objects; |
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
lipo -create libdevice.a libsimulator.a -output libcombined.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
set -e | |
set -x | |
input=$1 | |
output=$2 | |
input_cert=$(echo $input)-cert.p12 | |
input_key=$(echo $input)-key.p12 | |
input_file_not_exists=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
ffmpeg -i input.mp4 -s hd480 -c:v libx264 -crf 23 -c:a aac -strict -2 output.mp4 |
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
- (void)setupSharedDirectoryForMacTest { | |
#ifndef DEBUG | |
return; | |
#endif | |
#ifndef TARGET_IPHONE_SIMULATOR | |
return; | |
#endif | |
NSLog(@"--------------------------------------------------------------------------------------------------------"); | |
NSFileManager *fileManager = [NSFileManager defaultManager]; | |
NSString *documentPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex: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
AVSpeechSynthesisVoice *SpeechVoiceFromLocaleLanguageCode(NSString *langCode) { | |
NSArray<NSString*> *langCodeParts = [[langCode stringByReplacingOccurrencesOfString:@"-" withString:@"_"] componentsSeparatedByString:@"_"]; | |
NSArray<AVSpeechSynthesisVoice*> *availTTSVoices = [AVSpeechSynthesisVoice speechVoices]; | |
NSMutableArray<AVSpeechSynthesisVoice*> *filteredVoices = [NSMutableArray array]; | |
AVSpeechSynthesisVoice *selectedVoice = nil, *defaultVoice = nil; | |
// first round filter, uses prefix. | |
for (AVSpeechSynthesisVoice *voice in availTTSVoices) { | |
if (!defaultVoice && [voice.language isEqualToString:@"en-US"]) { | |
defaultVoice = voice; | |
} |
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
local url = "https://api.waqi.info/feed/@UID/?token=Demo-Token" | |
-- fill your UID and token | |
local menubar = hs.menubar.new() | |
function getColor(aqi) | |
if aqi <= 50 then | |
return {red = 0, blue = 0, green = 1} | |
end | |
if aqi <= 100 then |
OlderNewer