#This gist was moved to a open source project SweetConsole
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
| /** | |
| * Dispatcher | |
| * Author: Jan Cassio <hey@jancassio.com> | |
| * | |
| * A small event dispacher helper for general usage. | |
| */ | |
| var Dispatcher = { | |
| events: {}, | |
| /** | |
| * Emit an event that can be handled by subscribed handlers. |
#iOS Google Analytics and Flurry Tracker
This is a very simple helper track GAI and Flurry screen views and events quickly. Of course, you can customize based on marketing plan to increase tracking precision.
Before use the Tracker, you need to initialize then, the best place to do this is in your AppDelegate file, at application:didFinishLaunchingWithOptions:launchOptions callback.
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
| /** | |
| * Compare a string (a la c) with other and return -1 if smaller, 0 if equals or 1 if higher | |
| * @author: Jan Cássio | hey@jancassio.com | |
| * @usage | |
| * "cupcake".compare("chocolate"); // returns 1; | |
| * "sounds good".compare("sounds good"); // return 0; | |
| * "10.1".compare("10.105"); // returns -1; | |
| */ | |
| String.prototype.compare = function(other) | |
| { |
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
| /** | |
| * Simple string format. | |
| * @author: Jan Cássio | hey@jancassio.com | |
| * @usage | |
| * "{0} World, my name is {1}".format("Hello", "Jan"); // returns "Hello world, my name is Jan"; | |
| */ | |
| String.prototype.format = function() | |
| { | |
| var i, result, pattern; | |
NewerOlder