Cheat sheet for porting between CoffeeScript, Dart, Haxe, TypeScript and Lua.
Types supported.
while(1) { | |
strcpy(fsm.state[x][z], lines[i]); | |
printf("%i %i\n", x, z); | |
z++; i++; | |
if(strcmp(lines[i], ".") == 0) x++; z = 0; | |
if(strcmp(lines[i], "") == 0) break; | |
} |
module MyModule | |
# Public methods..... | |
def self.doSomething(parameter) | |
... | |
end | |
def self.doSomethingElse() | |
... | |
end |
// Clear the canvas. | |
context.clearRect(0, canvas.width, canvas.height); | |
/* Where context is a CanvasCanvasRenderingContext2D object | |
assigned via canvas.getContext("2d"); and canvas is | |
a canvas element. */ |
<canvas id="demo-base" style="z-index: 0;" width="730" height="300"> | |
</canvas> | |
<canvas id="demo-ui" style="z-index: 1;" width="730" height="300"> | |
</canvas> | |
<canvas id="demo-overlay" style="z-index: 2;" width="730" height="300"> | |
<!-- Message when CANVAS is not supported --> | |
<em>Your browser does not support the CANVAS element.<br/> | |
Please use an <a href="http://html5.com">HTML5</a> | |
-compliant browser to view this demonstration.</em> | |
<!-- /Message --> |
/* (Demonstration) canvases. */ | |
canvas { | |
position: absolute; | |
margin: auto; | |
border: 1px solid #c3c3c3; | |
} | |
/* 'position: absolute;' is used as I found this caused the canvases | |
to stack upon each other in layers as I had intended. */ |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<!-- Use UTF-8 encoding as it supports many characters --> | |
<meta charset="UTF-8"/> | |
<!-- Include stylesheet --> | |
<link rel="stylesheet" media="screen" type="text/css" | |
href="stylesheets/presenter.css"/> | |
<!-- Include Atom feed of project commits --> | |
<link rel="alternate" type="application/atom+xml" |
private void WriteXNBVideoData(string video) | |
{ | |
string file = video + ".xnb"; | |
// Only write the file when the file name is qualified correctly. | |
if(!file.Equals(".xnb")) | |
{ | |
using(BinaryWriter bw = new BinaryWriter(File.Open("Content/" + file, FileMode.Create, FileAccess.Write))) | |
{ | |
byte[] bytes = { 0x58, 0x4E, 0x42, 0x77, 0x05, 0x01, 0x55, 0x01, |
/* | |
jQuery module to get URL parameters. | |
Copied from: http://stackoverflow.com/questions/19491336/get-url-parameter-jquery | |
Minified. | |
*/ | |
$.urlParam=function(a){var b=new RegExp("[?&]"+a+"=([^&#]*)").exec(window.location.href);if(b==null){return null}else{return b[1]||0}}; |