Skip to content

Instantly share code, notes, and snippets.

View fruit's full-sized avatar

Ilya Sabelnikov fruit

  • Sun Finance
  • Latvia, Riga
  • 08:45 (UTC +03:00)
  • X @frufrufru
View GitHub Profile

Keybase proof

I hereby claim:

  • I am fruit on github.
  • I am frufrufru (https://keybase.io/frufrufru) on keybase.
  • I have a public key ASDy8sTuikQjFbjhlM1iUbm-5Qt3swSFjsez4WqAWh5Vtwo

To claim this, I am signing this object:

@fruit
fruit / vmboxcontrol
Last active August 29, 2015 14:17
Automatically shutdown VirtualBox/Vagrant VM's on system restart or halt (Ubuntu 14.04)
#!/bin/sh
# Author: Ilya Sabelnikov <fruit.dev@gmail.com>
# Version: 1.0.0
### BEGIN INIT INFO
# Provides: vmboxcontrol
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start:
@fruit
fruit / escape_perf.php
Created November 21, 2012 00:23
Comparing str_replace versus preg_quote
<?php
$namespace = 'Doctrine\Common\Annotations\Annotation\Attribute';
$it = 5;
$c = 1000000;
sleep(3);
$tm = microtime(1);
$sum = 0;
for ($t = 0; $t < $it; $t++)
@fruit
fruit / SimilarityTool.class.php
Created May 11, 2011 21:16
String comparing algorithm
<?php
/**
* This class implements string comparison algorithm
* based on character pair similarity
*
* @link http://www.catalysoft.com/articles/StrikeAMatch.html
* @author Ilya Sabelnikov <fruit.dev@gmail.com>
*/
class SimilarityTool