Skip to content

Instantly share code, notes, and snippets.

View mariuszklinger's full-sized avatar
🏖️
Remote dev

Mariusz Klinger mariuszklinger

🏖️
Remote dev
View GitHub Profile
@mariuszklinger
mariuszklinger / infinite-flat.js
Last active January 29, 2020 11:15
custom infinite flat() in js
const example1 = [[1, 1, 1, [1.4, 1.6]], 666, [2, 3, [[4], [5, 6]]]];
function flat(arr) {
const stack = arr;
const result = [];
while (stack.length) {
const current = stack.shift();
const isCurrentArray = Array.isArray(current);
import scala.collection.mutable.PriorityQueue
import scala.math.Ordering._
import scala.util.Sorting
import Implicits._
class MyType{
}
object Implicits {
@mariuszklinger
mariuszklinger / robot.js
Created December 9, 2012 12:24
Breakfast_Time
var Robot = function(robot) {
this.speed = 30;
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.clone();
robot.ahead(this.speed);