Skip to content

Instantly share code, notes, and snippets.

- (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;
}
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);
//
// AccountsViewController.h
//
// Created by Nico Hämäläinen on 28/03/14.
//
#import <UIKit/UIKit.h>
@interface AccountsViewController : UIViewController
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
// 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];
#import <Foundation/Foundation.h>
@interface IOSTools : NSObject
- (NSString *)getCountry;
@end
reduce(
emailAddressField.textDynamic(),
passwordField.textDynamic(),
confirmPasswordField.textDynamic(),
false) { email, password, confirm in
return email != "" && password != "" && confirm != "" && password == confirm
} ->> signupButton
// Grab API instance
let API = APIClient.instance
// Attempt to authenticate with username and password
let Authentication = API.authenticate(username, password: password)
Authentication.onSuccess { user in
println("Logged in as \(user.userName!)!")
// Load user images after a successful sign-in
let UserImages = API.imagesForUserId(user.id!, nextToken: nil)
// Brawl Tests
import * as Brawl from "./brawl"
// Create a new match
let match = new Brawl.Match();
// Enter some players
let friendly = new Brawl.Player("Friendly", match);
let opposing = new Brawl.Player("Opposing", match);
@clooth
clooth / Git aliases
Created November 16, 2011 17:57
quick and simple git aliases
# Git
alias gs='git status'
alias go='git checkout'
alias gadd='git add -p'
alias gi='git commit'
alias gd='git diff'
alias gb='git branch'
alias gl='git log'