Skip to content

Instantly share code, notes, and snippets.

View ivanbogomoloff's full-sized avatar

ivan ivanbogomoloff

View GitHub Profile
while true; do date; ps aux|grep php|wc -l; sleep 1;done
@ivanbogomoloff
ivanbogomoloff / PS1 in terminal
Created October 17, 2017 08:18
PS1 in terminal
PS1="\033[01;32m[\w]\[\033[00m\] \D{%T}\$(__git_ps1)$ "
//will produce [/your/directory] 11:15:34 (branchname)$
@ivanbogomoloff
ivanbogomoloff / gist:c6fd28af0623f9e22fbf
Last active February 1, 2016 14:42
ttet builded blocks
/**
* Инвертирования бинарного массива
* @returns {Array}
*/
Array.prototype.binInverse = function() {
var ar = this;
var newar = new Array(ar.length - 1);
for(var i = 0; i < ar.length; i++)
{
if (typeof (ar[i]) == 'object') {
@ivanbogomoloff
ivanbogomoloff / gist:ec3010454873f3fbe04b
Created September 26, 2015 10:02 — forked from Joncom/gist:e8e8d18ebe7fe55c3894
Check if two line segments intersect
// Adapted from: http://stackoverflow.com/questions/563198/how-do-you-detect-where-two-line-segments-intersect/1968345#1968345
function line_intersects(p0_x, p0_y, p1_x, p1_y, p2_x, p2_y, p3_x, p3_y) {
var s1_x, s1_y, s2_x, s2_y;
s1_x = p1_x - p0_x;
s1_y = p1_y - p0_y;
s2_x = p3_x - p2_x;
s2_y = p3_y - p2_y;
var s, t;
<?php
require_once dirname(__DIR__).'/../../../../app/AppKernel.php';
/**
* Test case class helpful with Entity tests requiring the database interaction.
* For regular entity tests it's better to extend standard \PHPUnit_Framework_TestCase instead.
*/
abstract class KernelAwareTest extends \PHPUnit_Framework_TestCase
{