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
| <?php | |
| public function callOldVersion($argumentsList) { | |
| //If they have requested a NON current API version | |
| if (APIHelpers::$API_VERSION != APIHelpers::CURRENT_API_VERSION) { | |
| //get the name of the method that they have called | |
| $actionName = $this->dispatcher->getActionName(); |
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
| <?php | |
| public function __call($method, $arguments) { | |
| $realMethodName = "_" . $method; | |
| if (method_exists($this, $realMethodName)) { | |
| $response = $this->callOldVersion($arguments); |
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
| let types = UIUserNotificationSettings(forTypes: [UIUserNotificationType.Alert, UIUserNotificationType.Badge, UIUserNotificationType.Sound], categories: nil) | |
| UIApplication.sharedApplication().registerUserNotificationSettings(types) | |
| UIApplication.sharedApplication().registerForRemoteNotifications() |
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
| //Load a nib with a given name | |
| class func loadFromNibNamed(nibNamed: String, bundle : NSBundle = NSBundle.mainBundle()) -> UIView! { | |
| return UINib(nibName: nibNamed, bundle: bundle).instantiateWithOwner(nil, options: nil)[0] as? UIView | |
| } |
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
| <?php | |
| while (true) { | |
| //poll database | |
| //send messages over XMPP connection | |
| //take a nap | |
| sleep(5); | |
| } |
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
| <?php | |
| //Initialize | |
| $this->client = new JAXL(array( | |
| 'jid' => $this->senderId .'@gcm.googleapis.com', | |
| 'pass' => $this->googleApiKey, | |
| 'auth_type' => 'PLAIN', | |
| 'host' => $this->host, | |
| 'port' => $this->port, | |
| 'strict' => false, |
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
| enum PAGE_STATE { INITIALIZING, LOADING, LOADED, NETWORK_ISSUES } | |
| PAGE_STATE currentState = PAGE_STATE.INITIALIZING; |
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
| new Handler(Looper.getMainLooper()).post(new Runnable() { | |
| @Override | |
| public void run() { | |
| //stuff to run on the main thread | |
| } | |
| }); |
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
| if (adapter == null) { | |
| adapter = new PhotoAdapter(getChildFragmentManager()); | |
| } | |
| adapter.clearCache(); | |
| pager.setAdapter(adapter); |
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
| Boolean clearCache = false; | |
| public void clearCache() { | |
| mFragments.clear(); | |
| clearCache = true; | |
| } |