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
- (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
// 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
// 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
# | |
# 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
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
// | |
// HorizontalSlideSegue.m | |
// YouLapse | |
// | |
// Created by Nico Hämäläinen on 9/27/13. | |
// Copyright (c) 2013 YouLapse Oy. All rights reserved. | |
// | |
#import "HorizontalSlidePushSegue.h" |
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
Check dependencies | |
warning: no rule to process file '/Users/nico/Development/Clash/Clash/lua' of type folder for architecture x86_64 | |
Ld /Users/nico/Library/Developer/Xcode/DerivedData/Clash-bzzjyeknflrxrvezjpmtiemmampa/Build/Products/Debug/Clash.app/Contents/MacOS/Clash normal x86_64 | |
cd /Users/nico/Development/Clash | |
setenv MACOSX_DEPLOYMENT_TARGET 10.8 | |
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -L/Users/nico/Library/Developer/Xcode/DerivedData/Clash-bzzjyeknflrxrvezjpmtiemmampa/Build/Products/Debug -L/usr/local/lib -L/usr/local/Cellar/boost/1.54.0/lib -F/Users/nico/Library/Developer/Xcode/DerivedData/Clash-bzzjyeknflrxrvezjpmtiemmampa/Build/Products/Debug -F/Library/Frameworks -F/usr/local/Frameworks -F/Library/Frameworks -filelist /Users/nico/Library/Developer/Xcode/DerivedData/Clash-bzzjyeknflrxrvezjpmtiemmampa/Build/Inter |
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
// Map scrolling functions | |
auto panMap = [&mapView, &minimapView] (float speed, int dir) { | |
float timeValue = TimePerFrame.asSeconds(); | |
float moveValue = speed * timeValue; | |
if (dir == 0) { mapView.move(-moveValue, 0.f); minimapView.move(-moveValue, 0.f); } | |
if (dir == 1) { mapView.move(moveValue, 0.f); minimapView.move(moveValue, 0.f); } | |
if (dir == 2) { mapView.move(0.f, -moveValue); minimapView.move(0.f, -moveValue); } | |
if (dir == 3) { mapView.move(0.f, moveValue); minimapView.move(0.f, moveValue); } | |
}; |
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
// Map scrolling functions | |
auto panMap = [&mapView, &minimapView] (float speed, int dir) { | |
float timeValue = TimePerFrame.asSeconds(); | |
float moveValue = speed * timeValue; | |
if (dir == 0) { mapView.move(-moveValue, 0.f); minimapView.move(-moveValue, 0.f); } | |
if (dir == 1) { mapView.move(moveValue, 0.f); minimapView.move(moveValue, 0.f); } | |
if (dir == 2) { mapView.move(0.f, -moveValue); minimapView.move(0.f, -moveValue); } | |
if (dir == 3) { mapView.move(0.f, moveValue); minimapView.move(0.f, moveValue); } | |
}; |