Skip to content

Instantly share code, notes, and snippets.

@mbrevda
mbrevda / gist:e17e7e05b68a0bb06793
Last active November 11, 2015 20:39
Fresh disposable chomre instance
alias newc='tmp=`date +%Y%m%d%H%M%S`; open -na "Google Chrome" --args --user-data-dir=/tmp/$tmp --no-first-run --disable-extensions --safe-plugins --disable-default-apps --disable-save-password-bubble --disable-session-storage --disable-sync --disable-zero-browsers-open-for-tests'
@mbrevda
mbrevda / SlatedHandler.php
Created April 6, 2014 15:06
Example of Software defined crons (SlatedHandler)
<?php
namespace Framework;
class SlatedHandler
{
/**
* @var Framework\App
*/
private $app;
@mbrevda
mbrevda / gist:5004913
Created February 21, 2013 14:02
PHP concatenate vs implode test
time php -r 'ini_set("memory_limit", "2048M");$a=[];for($i=0;$i<1000000;$i++){$a[]=$i;}implode($a);'
time php -r 'ini_set("memory_limit", "2048M");$a="";for($i=0;$i<1000000;$i++){$a.=$i;}'
@mbrevda
mbrevda / gist:4618456
Created January 24, 2013 07:38
Find Pebble watch backer position
for i in {0..1362}; do echo Searching page $i...; wget -q -O- http://www.kickstarter.com/projects/597507018/pebble-e-paper-watch-for-iphone-and-android/backers?page=$i|grep YOUR_NAME_HERE && break; done
@mbrevda
mbrevda / gist:4352611
Last active December 10, 2015 00:39
Asterisk 10
require 'formula'
class Asterisk < Formula
homepage 'http://asterisk.org'
url 'http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-10.11.0.tar.gz'
sha1 'a678774bd6cb90fb4cefe115eb91a30228410288'
env :std
fails_with :clang
def options
[['--with-samples', "Install the sample config files. NOTE. Without this, you won't have any config files."]]