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
document.onkeydown = function(e){ | |
switch(e.key) { | |
case "1": | |
document.querySelectorAll("button.answerA")[0].click(); | |
break; | |
case "2": | |
document.querySelectorAll("button.answerB")[0].click(); | |
break; | |
case "3": | |
document.querySelectorAll("button.answerC")[0].click(); |
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
public enum RoomType { | |
} | |
public class Hotel { | |
private Room[] rooms; | |
public String name; |
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 log = require('util').log; | |
var http = require('http'); | |
var express = require('express'); | |
var app = express(); | |
var server = http.createServer(app); | |
var path = require('path'); | |
var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest; | |
//implement http config |
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 AsciiImage = (function() { | |
var image = document.createElement('image'); | |
var canvas = document.createElemnt('canvas'); | |
var ctx = canvas.getContext('2d'); | |
return function (url) { | |
image.src = url; | |
ctx.drawImage(image,0,0); | |
} | |
})(); |
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
// Author: Andrei Gheorghe (http://github.com/idevelop) | |
var ascii = (function() { | |
function asciiFromCanvas(canvas, options) { | |
// Original code by Jacob Seidelin (http://www.nihilogic.dk/labs/jsascii/) | |
// Heavily modified by Andrei Gheorghe (http://github.com/idevelop) | |
var characters = (" .,:;i1tfLCG08@").split(""); | |
var context = canvas.getContext("2d"); |
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 color = function() { | |
var hex = new RegExp("^([a-fA-F0-9]){3,6}$","g"); | |
var rgb = new RegExp("(rgb\([0-255],[0-255],[0-255]\))","g"); | |
return function(c) { | |
} |
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 iter = function() { | |
var lev = 0; | |
var levels = [0,0,0,0]; | |
var uls = [$('<ul>')]; | |
return function(obj,level) { | |
for (var prop in obj) { | |
if (obj.hasOwnProperty(prop)) { | |
levels[lev]++; | |
if (typeof obj[prop] == 'object') { | |
uls[lev].append($('<li>').text(prop + ":")); |
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
function colCheck(a,b) { | |
var acx = a.w/2 + a.x, | |
acy = a.h/2 + a.y, | |
bcx = b.w/2 + b.x, | |
bcy = b.h/2 + b.y; | |
var w = (a.w + b.w)/2, | |
h = (a.h + b.h)/2, | |
dx = (acx - bcx), | |
dy = (acy - bcy); |
NewerOlder