Cheat sheet for porting between CoffeeScript, Dart, Haxe, TypeScript and Lua.
Types supported.
# | |
# Dockerfile for a container that provides Node.js and MongoDB. | |
# saintpettersens/nodemongodb | |
# | |
# Use Ubuntu as base for container. | |
FROM ubuntu | |
# Install MongoDB. | |
ENV mongorepo "http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" |
# Serve to outside world on port 2015. | |
0.0.0.0:2015 | |
# This rewrite stops caddy.sh being served. | |
rewrite { | |
regexp caddy\.sh | |
to / | |
} |
<script> | |
function format() { | |
var text = document.getElementById('formatter').value; | |
text = '\'' + text + '\'' | |
i = 0 | |
x = 1 | |
var newText = ''; | |
for(var i = 0; i < text.length; i++) { | |
if(x == 40) { |
import sys | |
import base64 | |
with open(sys.argv[1], 'rb') as binary_file: | |
encoded_string = base64.b64encode(binary_file.read()) | |
print(encoded_string) |
function isTouchScreenDevice() { | |
var isTouch = false; | |
var ua = navigator.userAgent; | |
if(ua.indexOf("Mobile") !== -1 || ua.indexOf("Tablet") !== -1) { | |
isTouch = true; | |
} | |
return isTouch; | |
} | |
window.onload = function() { |
Cards.prototype.sort = function() { | |
this.sorted_hearts = []; | |
this.sorted_diamonds = []; | |
this.sorted_clubs = []; | |
this.sorted_spades = []; | |
for(var i = 0; i < this.deck.length; i++) { | |
var rs = this.deck[i].split(' '); | |
var num = 0 | |
if(rs[0] == 'A') num = 1; // Ace | |
else if(rs[0] == 'J') num = 11; // Jack |
/* | |
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}}; |
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, |
// Define a Caption 'class'. | |
function Caption(message, color, x, y) { | |
// Properties. | |
this.message = message; | |
this.color = color; | |
this.x = x; | |
this.y = y; | |
// Methods. |