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 Crafty = require('craftyjs'); | |
Crafty.init(800, 600); | |
Crafty.background('black'); | |
/** | |
* Chaser Component. Automatically chases entity given speed. | |
*/ | |
Crafty.c("Chaser", { | |
required: "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
// Copyright Daniel Berger | |
// see https://groups.google.com/forum/#!topic/craftyjs/1oOwQrcCd-4 | |
var Crafty = require('craftyjs'); | |
Crafty.init(960, 660); | |
var computeSpeed = function() { | |
return 500 + (500 ^ 2 * (((((Floor.y / player.y) ^ 2 + 2 + (player.y / Floor.y) ^ 2) ^ 0.5) * Floor.y * player.y) ^ 0.5) / (((((Floor.x / player.x) ^ 2 + 2 + (player.x / Floor.x) ^ 2) ^ 0.5) * Floor.x * player.x) ^ 0.5)) ^ 0.5 | |
}; |
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
<html> | |
<head> | |
<script src="https://wzrd.in/bundle/[email protected]"></script> | |
<script src="https://wzrd.in/bundle/[email protected]"></script> | |
<script src="https://wzrd.in/bundle/[email protected]"></script> | |
</head> | |
<body> | |
<script> | |
var Benchmark = require('benchmark'); | |
var suite = new Benchmark.Suite; |
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
all: libsudoku.js sudoku.js sudoku | |
clean: | |
rm -f libsudoku.js sudoku.js sudoku | |
rm -f libsudoku.js.map sudoku.js.map | |
rm -f libsudoku.js.mem sudoku.js.mem | |
# library for using functions in hand written JavaScript code | |
libsudoku.js: libsudoku.c | |
emcc -g4 -Wall -Wextra -std=c11 $^ -o $@ \ | |
-s EXPORTED_FUNCTIONS="['_output', '_sudoku']" \ |
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
<html> | |
<head> | |
</head> | |
<body> | |
<script src="https://wzrd.in/bundle/craftyjs@latest"></script> | |
<script> | |
var Crafty = require("craftyjs"); | |
Crafty.init(); | |
Crafty.background('rgb(127,127,127)'); | |
</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
// See [this tutorial](http://www.flipcode.com/archives/Raytracing_Topics_Techniques-Part_4_Spatial_Subdivisions.shtml) and linked materials | |
// | |
// return distance to nearest corner of rectangle, | |
// or return Infinity if no intersection with ray | |
// | |
// origin = {_x, _y} | |
// direction = {x, y} | |
function approximateDistanceFromRay(origin, direction) { | |
var epsilon = 0.00000001; //maximum error allowed |
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
active_guide | |
argument-name | |
block_cursor | |
brackethighlighter.curly | |
brackethighlighter.tag | |
class | |
class-inheritance | |
class-name | |
comment | |
comment.block |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
FROM node:12-alpine | |
RUN apk add --no-cache tini | |
RUN apk add --no-cache curl | |
ADD https://raw.githubusercontent.com/eficode/wait-for/master/wait-for /bin/wait-for.sh | |
RUN chmod +rx /bin/wait-for.sh | |
USER node | |
RUN mkdir -p /home/node/app | |
WORKDIR /home/node/app |
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
async function main() { | |
const rej = Promise.reject('err') | |
// the following line is needed, | |
// otherwise UnhandledPromiseRejectionWarning is thrown | |
// which can't be caught anywhere else (not even by async caller)! | |
// can be NOOP though, if error handling may be delayed to below catch block | |
rej.catch(e => console.log(e)) // logs 'err' | |
const del = new Promise((resolve) => { | |
setTimeout(() => resolve('del'), 100) |