Skip to content

Instantly share code, notes, and snippets.

View Kattoor's full-sized avatar

Jasper Catthoor Kattoor

View GitHub Profile
using UnityEngine;
using System.IO;
using System.Text;
using System;
public class TerrainHeightParser : MonoBehaviour {
private Terrain terrain;
private int hmWidth;
private int hmHeight;
'use strict';
var debugging = false;
var requestBinUrl = 'http://requestb.in/1b60sct1';
function setRequestParams(bundle, params) {
bundle.request.params = params;
return bundle.request;
}
@Kattoor
Kattoor / data.json
Created August 30, 2016 20:34
Get Facebook access token with only backend node.js
{
"email": "jasper_catthoor@hotmail.com",
"pass": "",
"client_id": "",
"client_secret": "",
"redirect_uri": "http://localhost:3000"
}
"use strict";
function overload(f1, f2) {
if (f1.length === f2.length)
throw new TypeError;
else
return function(...args) {
let params = Array.prototype.splice.call(arguments, 0);
if (params.length === f1.length)
"use strict";
var fs = require('fs');
var http = require('http');
var container = {};
var server = http.createServer(handleRequest);
function handleRequest(request, response) {
function getTarget() {
let entityValues = Object.values(parent.entities);
let greenWorms = entityValues.filter(entity => entity.mtype === 'worm');
let redWorms = entityValues.filter(entity => entity.mtype === 'osnake');
let target;
if (redWorms.length > 0)
target = findClosest(redWorms);
var startXp = getTotalXp();
var startTime = Date.now();
var hourlyXpArray = [];
var xpPerMinute;
function getTarget() {
let entityValues = Object.values(parent.entities);
//let greenWorms = entityValues.filter(entity => entity.mtype === 'armadillo');
//let redWorms = entityValues.filter(entity => entity.mtype === 'squigtoad');
const position = { x: 0, y: 0 }
// left up right down
const Dir = [ [0, 3, 1, {x: -1, y: 0}], [1, 0, 2, {x: 0, y: 1}], [2, 1, 3, {x: 1, y: 0}], [3, 2, 0, {x: 0, y: -1}]]
let currentDirectionIndex = 1
function move(input) {
const dir = input[0]
const steps = input.substr(1)
const position = { x: 0, y: 0 }
// left up right down
const Dir = [ [0, 3, 1, {x: -1, y: 0}], [1, 0, 2, {x: 0, y: 1}], [2, 1, 3, {x: 1, y: 0}], [3, 2, 0, {x: 0, y: -1}]]
const positionHistory = []
let currentDirectionIndex = 1
function move(input) {
var container = {
application: {
id: "awesome-app",
state: {
id: "running"
},
solution: {
id: "awesome-solution",
application: [
{