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
// store the canvas image and push to local storage | |
var storeHistory = function () { | |
img = canvas.toDataURL("image/png"); | |
history.pushState({ imageData: img }, "", window.location.href); | |
if (window.localStorage) { localStorage.curImg = img; } | |
}; | |
//retrieve local storage |
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
var PORT = process.env.PORT; | |
var http = require('http'); | |
var server = http.createServer(function (req, res) { | |
res.writeHead(200, {"Content-Type" : "text/plain"}); | |
res.end("hello world"); | |
}); | |
server.listen(PORT); |
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
if (me.game.STATE.weaponState === "magic_torrentacle") { | |
if (this.direction === "west") { | |
magic = new MagicEntity(this.pos.x - 100, this.pos.y + 30 , { image: "magic_torrentacle", spriteheight: 128, spritewidth: 128}); | |
magic.flipX(true); | |
me.game.add(magic, this.z); | |
me.game.sort(); | |
} else if (this.direction === "east") { | |
magic = new MagicEntity(this.pos.x + 42, this.pos.y + 30, { image: "magic_torrentacle", spriteheight: 128, spritewidth: 128 }); | |
me.game.add(magic, this.z); | |
me.game.sort(); |
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
class Greeter { | |
greeting: string; | |
constructor (message: string) { | |
this.greeting = message; | |
} | |
greet() { | |
return "Hello, " + this.greeting; | |
} | |
} |
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
var Greeter = (function () { | |
function Greeter(message) { | |
this.greeting = message; | |
} | |
Greeter.prototype.greet = function () { | |
return "Hello, " + this.greeting; | |
}; | |
return Greeter; | |
})(); | |
var greeter = new Greeter("world"); |
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
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { | |
if ((navigationType == UIWebViewNavigationTypeLinkClicked) && | |
([[[request URL] absoluteString] hasPrefix:@"https://www.google.com"])) | |
{ | |
[[UIApplication sharedApplication] openURL:request.URL]; | |
return NO; | |
} | |
return YES; | |
} |
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
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { | |
if ((navigationType == UIWebViewNavigationTypeLinkClicked) && ([[url absoluteString] hasSuffix:@"?openExternal=1"] )) | |
{ | |
[[UIApplication sharedApplication] openURL:url]; | |
return NO; | |
} | |
return YES; | |
} |
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
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { | |
NSURL *url = [request URL]; | |
if ( ([url fragment] != NULL) && ([[url fragment] rangeOfString:@"openExternal=true"].location != NSNotFound) ) | |
{ | |
if ([[UIApplication sharedApplication] canOpenURL:url]) { | |
[[UIApplication sharedApplication] openURL:url]; | |
return NO; | |
} | |
} | |
return YES; |
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
/* turn all target = _blanks into whitelisted urls */ | |
$(document).on("click", function (event) { | |
if (event.target.target === "_blank" && event.target.href.indexOf("#openExternal=true") === -1) { | |
event.target.href = event.target.href + "#openExternal=true"; | |
} | |
}); |
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
.cg-navbar { | |
max-width: 100% | |
} | |
.cg-navbar__bar { | |
padding: 0; | |
display: table; table-layout:fixed; width: 100%;, | |
} | |
.cg-navbar__baritem{ |
OlderNewer