Skip to content

Instantly share code, notes, and snippets.

View Isinlor's full-sized avatar

Tomasz Darmetko Isinlor

View GitHub Profile
@Isinlor
Isinlor / robot.js
Created December 4, 2012 18:47
Lol2
var odd = 1;
//FightCode canonlyunderstand your robot
//if its class is calledRobot
var Robot = function(robot) {
robot.clone();
robot.turn(360);
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
@Isinlor
Isinlor / robot.js
Created December 5, 2012 11:12
Zolmeister
var Robot = function(robot){
robot.turnLeft(robot.angle % 90);
robot.clone();
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
if (robot.parentId) {
robot.ahead(1);
robot.turnGunRight(1);
}
@Isinlor
Isinlor / robot.js
Created December 5, 2012 11:51 — forked from Shipow/robot.js
Shipow#002 - New branch
var Robot = function(robot) {
robot.rotateCannon(-90);
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead();
//i'll add a clone but i need to refactor collision
robot.clone();
};
@Isinlor
Isinlor / robot.js
Created December 5, 2012 19:09 — forked from cgardner/robot.js
IsinBot
/*
* It would be great if you fork & upgrade
* created by; Zolmeister
* edited by: Isinlor
* - added clone
* - upgrade of aim - for cloned robot
* - upgrade of aim - counting missed attack and adaptation
* - upgrade of dodge - move according to the hp
* edited by: type your nickname
* - what you changed - description
@Isinlor
Isinlor / time.php
Last active August 29, 2015 14:02
workingTime
<?php
class workingTime {
public $start = 9;
public $end = 17; // 17:XX so also 17:59
public $freeWeekDays = array(0 => true,
6 => true); // week 0-6; true = free;
public $freeYearDays = []; // year 0-365; true = free;
public function __construct(array $config = []){
<?php
interface Middelware {
public function run(Request $request, Response $response, Pipe $next);
}
interface Pipe {
public function __invoke(Request $request, Response $response);
}
@Isinlor
Isinlor / README.md
Last active June 29, 2017 12:56 — forked from anonymous/elasticsearch-install.sh
Install Elastic Search v1.7 on Ubuntu 14.04

To install Elastic Search copy & paste into terminal:

wget https://gist.githubusercontent.com/Isinlor/12e80e1891128e77c661/raw/elasticsearch-install.sh && sudo chmod +x ./elasticsearch-install.sh && ./elasticsearch-install.sh

Remember to subscribe to Common Security Vulnerabilities (CVE):

Ubuntu:

@Isinlor
Isinlor / lazy-consecutive-biggest-product.php
Last active January 28, 2016 14:29
Lazy generate consecutive biggest products of two arrays
<?php
function getAListProductIterator($aList, $aListSize, $bValue, $bIndex) {
for ($aIndex=0; $aIndex < $aListSize; $aIndex++) {
yield [
'product' => $aList[$aIndex] * $bValue,
'aIndex' => $aIndex,
'bIndex' => $bIndex
];
}
}
@Isinlor
Isinlor / DynamicLoops.php
Created February 22, 2016 15:24
Interface and calsses that allows dynamical nesting of loops
<?php
/**
* Interface DynamicLoops
*
* Allows to dynamically nest loops eg.:
*
* $loops = [
* function (DynamicLoops $nextLoop, array $values = []) {
* foreach (range(0, 1) as $value) {
@Isinlor
Isinlor / whitespaces.php
Last active March 3, 2016 09:25
Two functions to work with unicode whitespaces. See: http://php.net/manual/en/regexp.reference.unicode.php
<?php
$compactWhitespace = function ($string) {
return preg_replace('/[\pZ\pC]+/u', ' ', $string);
};
$trim = function ($string) {
return preg_replace('/^[\pZ\pC]+|[\pZ\pC]+$/u', '', $string);
};