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
| [NSKeyedArchiver archiveRootObject:Object toFile:filePath] | |
| [NSKeyedUnarchiver unarchiveObjectWithFile:filePath] |
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
| static NSString* GAEscapeNSString(NSString* value) { | |
| if (!value) return nil; | |
| const char *chars = [value UTF8String]; | |
| NSMutableString *escapedString = [NSMutableString string]; | |
| while (*chars) { | |
| if (*chars == '\\') { | |
| [escapedString appendString:@"\\\\"]; | |
| } else if (*chars == '\'') { | |
| [escapedString appendString:@"\\'"]; | |
| } else { |
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
| @throw [NSException exceptionWithName:@"GAJSException" | |
| reason:@"Failed to load JavaScriptEngine" | |
| userInfo:nil]; |
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
| NSRunAlertPanel(@"Tracker already running", @"The Tracker is already running.", @"OK", nil, nil); |
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
| "%s %s" % ["a", "b"] => "a b" |
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 a temp file path | |
| [NSTemporaryDirectory() stringByAppendingPathComponent:@"myapptempdirectory.jpg"]); | |
| // To get the filename from the url | |
| [@"http://stackoverflow.com/questions/1098957/objective-c-extract-filename-from-path-string.jpg" lastPathComponent]; |
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
| curl --data-binary @sound.spx --header 'Content-type: audio/x-speex-with-header-byte; rate=16000' 'https://www.google.com/speech-api/v1/recognize?client=chromium&lang=en-US&maxresults=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/perl -w | |
| # Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. | |
| # | |
| # Redistribution and use in source and binary forms, with or without | |
| # modification, are permitted provided that the following conditions | |
| # are met: | |
| # | |
| # 1. Redistributions of source code must retain the above copyright | |
| # notice, this list of conditions and the following disclaimer. |
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
| require "rubygems" | |
| require "rspec" | |
| class String | |
| def syllable | |
| # bl|qu|ng|ch|rt| | |
| consonants = "bcdfghjklmnpqrstvwxzh" | |
| vowels = "aeiouy" | |
| word = self.downcase | |
| parts = word.split(/(?=ly)/) |
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
| codesign -f -v -s "Mac Developer: lixing he (6EAVUH8752)" ./Sparkle.framework/Versions/A/Resources/relaunch |