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
| newQuad.bl.textureVertex = CGPointMake(0, 0); | |
| newQuad.br.textureVertex = CGPointMake(1, 0); | |
| newQuad.tl.textureVertex = CGPointMake(0, 1); | |
| newQuad.br.textureVertex = CGPointMake(1, 1); |
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
| # | |
| # Resizyr - WebGL Image Resizer | |
| # | |
| # Extensions | |
| # This allows us to do for example the following: | |
| # 5.times () -> console.log "foo" | |
| # | |
| Number::times = (fn) -> | |
| do fn for [1..@valueOf()] |
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
| // Create dummy click event for automation | |
| var click = new MouseEvent('click', { 'clientX': 1,'clientY': 1 }); | |
| // Create button boilerplate | |
| function createButton(title, action) { | |
| var button = document.createElement('button'); | |
| button.innerText = title; | |
| button.onclick = function(e) { | |
| e.preventDefault(); | |
| action(e); |
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
| // Constants | |
| #define APP_VERSION [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"] | |
| #define APP_NAME [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"] | |
| #define APP_DELEGATE [[UIApplication sharedApplication] delegate] | |
| #define USER_DEFAULTS [NSUserDefaults standardUserDefaults] | |
| #define APPLICATION [UIApplication sharedApplication] | |
| #define BUNDLE [NSBundle mainBundle] | |
| #define MAIN_SCREEN [UIScreen mainScreen] | |
| #define FILE_MANAGER [NSFileManager defaultManager] | |
| #define DOCUMENTS_DIR [[FILE_MANAGER URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject] |
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
| - (void)keyboardWasShown:(NSNotification *)notification { | |
| CGSize keyboardSize = [[[notification userInfo] objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size; | |
| // Screen size | |
| CGSize screenSize = [[UIApplication sharedApplication] delegate].window.frame.size; | |
| // Viewport size | |
| CGFloat viewportHeight = screenSize.height - keyboardSize.height; | |
| } |
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
| javascript:(function(d){els=d.querySelectorAll('*');for(i=0;i<els.length;i++){e=els[i];e.style.color='transparent';e.style.backgroundImage='none';if(e.nodeName=='IMG')e.style.visibility='hidden';}})(document); |
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
| // | |
| // AccountsViewController.h | |
| // | |
| // Created by Nico Hämäläinen on 28/03/14. | |
| // | |
| #import <UIKit/UIKit.h> | |
| @interface AccountsViewController : UIViewController |
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
| NSFileManager *fileManager = [NSFileManager defaultManager]; | |
| NSArray *contents = [fileManager contentsOfDirectoryAtPath:directoryPath error:NULL]; | |
| NSEnumerator *e = [contents objectEnumerator]; | |
| NSString *filename; | |
| while ((filename = [e nextObject])) { | |
| NSString *filePath = [directoryPath stringByAppendingPathComponent:filename]; | |
| if ([[filePath pathExtension] isEqualToString:@"jpg"]) { | |
| // jpegitz |
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
| // Splitter view recognizer should only begin if we're truly touching something inside the splitter view | |
| - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer | |
| { | |
| if (gestureRecognizer == _splitterPanRecognizer) { | |
| CGPoint location = [gestureRecognizer locationInView:self.view]; | |
| BOOL didHitView = NO; | |
| NSArray *hitTestViews = @[_splitterView]; | |
| hitTestViews = [hitTestViews arrayByAddingObjectsFromArray:_splitterView.subviews]; |
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
| #import <Foundation/Foundation.h> | |
| @interface IOSTools : NSObject | |
| - (NSString *)getCountry; | |
| @end |