This file contains 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
stage.nativeWindow.x = (Screen.mainScreen.bounds.width - stage.nativeWindow.width) * .5; | |
stage.nativeWindow.y = (Screen.mainScreen.bounds.height - stage.nativeWindow.height) * .5; |
This file contains 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
// Embedding | |
[Embed(source="/../media/fonts/DINPro-Medium.otf", embedAsCFF="false", fontFamily="DinProMedium")] | |
public static const DinProMedium:Class; | |
[Embed(source="/../media/fonts/OpenSans-Regular.ttf", embedAsCFF="false", fontFamily="OpenSansRegular")] | |
public static const OpenSansRegular:Class; | |
[Embed(source="/../media/fonts/OpenSans-Semibold.ttf", embedAsCFF="false", fontFamily="OpenSansSemibold")] | |
// Usage | |
Config.OpenSansRegular; |
This file contains 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
$data = array( | |
'Author' => array( | |
'ip' => $ip, | |
'ua' => $ua | |
) | |
); | |
if($this->Author->save($data)) | |
debug('SAVED NEW AUTHOR'); | |
else |
This file contains 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 | |
App::uses('AppController', 'Controller'); | |
class HomeController extends AppController { | |
public function index() { | |
// Load Author model | |
$this->loadModel('Author'); | |
// Load Authors controller |
This file contains 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 | |
session_start(); | |
define('WWW_ROOT', dirname(__FILE__) . DIRECTORY_SEPARATOR); | |
require_once WWW_ROOT . 'includes' . DIRECTORY_SEPARATOR . 'functions.php'; | |
require_once WWW_ROOT . 'classes' . DIRECTORY_SEPARATOR . 'Config.php'; | |
require_once(WWW_ROOT . 'dao' . DIRECTORY_SEPARATOR . 'UserDAO.php'); | |
require_once(WWW_ROOT . 'dao' . DIRECTORY_SEPARATOR . 'EventDAO.php'); |
This file contains 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
ln -s /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app /Applications/iPhone\ Simulator.app |
This file contains 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)enumerateFonts { | |
NSLog(@"[AppDelegate.enumerateFonts] Start enumerating fonts"); | |
for(NSString *fontFamilyStrings in [UIFont familyNames]) { | |
NSLog(@"[AppDelegate.enumerateFonts] Font family: %@", fontFamilyStrings); | |
for(NSString *fontStrings in [UIFont fontNamesForFamilyName:fontFamilyStrings]) { | |
NSLog(@"[AppDelegate.enumerateFonts] Font: %@", fontStrings); | |
} | |
} | |
NSLog(@"[AppDelegate.enumerateFonts] End enumerating fonts"); | |
} |
This file contains 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
// delegate | |
#define UIAppDelegate (AppDelegate *)[[UIApplication sharedApplication] delegate] | |
#define APPDELEGATE ((AppDelegate *)[[UIApplication sharedApplication] delegate]) | |
// system | |
#define IS_IPHONE_4INCH (UI_USER_INTERFACE_IDIOM()==UIUserInterfaceIdiomPhone && [UIScreen mainScreen].bounds.size.height==568) | |
#define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) | |
// screen size | |
#define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) |
This file contains 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
AddType application/vnd.ms-fontobject .eot | |
AddType font/ttf .ttf | |
AddType font/otf .otf | |
AddType application/x-font-woff .woff |