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
var engine = new PHP ('<?php echo "Hello world!"; ?>'); | |
console.log( engine.vm.OUTPUT_BUFFER); // the outputted buffer from the script! |
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
// Typische UIViewController Methode | |
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
// Das aktuelle default NotificationCenter holen und in Variable "nc" referenzieren | |
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; | |
// Mit nc können wir jetzt.... | |
[nc |
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
// Irgendeine Methode in irgendeiner Klasse | |
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event | |
{ | |
// Das aktuelle default NotificationCenter holen und in Variable "nc" referenzieren | |
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; | |
// Mit nc können wir jetzt.... | |
[nc | |
postNotificationName:@"goToProfile" // Alle Abonnenten (subscriber) von "goToProfile" informieren... | |
object:self // und uns selbst bzw. die Instanz dieser Klasse (self) als Objekt übergeben |
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
// toProfileView wird vom NotificationCenter benachrichtigt und ausgeführt | |
-(void)toProfileView: (NSNotification *)notification | |
{ | |
// do Stuff... | |
UIView *object = [NSNotification object]; | |
} |
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
// Typische UIViewController Methode | |
// Wird ausgeführt wenn der View im Speicher | |
// vollständig geladen wurde. | |
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
// Wir sagen dem handle das er das mit dem Großbuchstaben bei | |
// neuen Wörtern einfach schon mal lassen soll. | |
self.handle.autocapitalizationType = UITextAutocapitalizationTypeNone; |
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
// Wird bei jeder Notification (jeder Tastenanschlag) | |
-(void)type | |
{ | |
// Text in Kleinbuchstaben umwandeln und wieder in den View schreiben | |
self.handle.text = [self.handle.text lowercaseString]; | |
} |
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
// page one: set cookie after successful login | |
setCookie("myLogin", "Username or a different String", 2); | |
// page two: get cookie with this variable name | |
var cookie = readCookie("myLogin"); | |
// redirect if theres no cookie with this variable | |
if (!cookie) { | |
// redirect to page one |
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
var createGame = require('voxel-engine') | |
function sphereWorld(x, y, z) { | |
// return the index of the material you want to show up | |
// 0 is air | |
if (x*x + y*y + z*z > 15*15) return 0 | |
return 3 | |
} | |
var game = createGame({ |
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
//Browsers | |
var IE6 = false /*@cc_on || @_jscript_version < 5.7 @*/ | |
var IE7 = (document.all && !window.opera && window.XMLHttpRequest && navigator.userAgent.toString().toLowerCase().indexOf('trident/4.0') == -1) ? true : false; | |
var IE8 = (navigator.userAgent.toString().toLowerCase().indexOf('trident/4.0') != -1); | |
var IE9 = navigator.userAgent.toString().toLowerCase().indexOf("trident/5")>-1; | |
var IE10 = navigator.userAgent.toString().toLowerCase().indexOf("trident/6")>-1; | |
var SAFARI = (navigator.userAgent.toString().toLowerCase().indexOf("safari") != -1) && (navigator.userAgent.toString().toLowerCase().indexOf("chrome") == -1); | |
var FIREFOX = (navigator.userAgent.toString().toLowerCase().indexOf("firefox") != -1); | |
var CHROME = (navigator.userAgent.toString().toLowerCase().indexOf("chrome") != -1); | |
var MOBILE_SAFARI = ((navigator.userAgent.toString().toLowerCase().indexOf("iphone")!=-1) || (navigator.userAgent.toString().toLowerCase().indexOf("ipod")!=-1) || (navigator.userAgent.toString().toLowerCase().indexOf(" |
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
"\e[A": history-search-backward | |
"\e[B": history-search-forward | |
set show-all-if-ambiguous on | |
set completion-ignore-case on |
OlderNewer