Skip to content

Instantly share code, notes, and snippets.

Piotr Belina piotrbelina

Block or report user

Report or block piotrbelina

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
piotrbelina / .Xmodmap
Last active Aug 29, 2015
Linux Ubuntu Mac Keyboard
View .Xmodmap
clear control
clear mod4
clear mod1
keycode 37 = Super_L
keycode 64 = Control_L
keycode 133 = Alt_L Meta_L
add mod1 = Alt_L Meta_L
add control = Control_L
piotrbelina /
Created Feb 19, 2014
remove all branches on remote already merged to master
git branch -r --merged |
grep origin |
grep -v '>' |
grep -v master |
grep -v vendor |
grep -v rtm |
xargs -L1 |
awk '{sub(/origin\//,"");print}' |
xargs git push -v origin --delete
View di.php
class B {}
class A {
protected $b;
public function __construct()
$this->b = new B();
piotrbelina / BoomerangLogJob.scala
Created Aug 3, 2013
Scalding apache log parser for boomerang.js
View BoomerangLogJob.scala
import cascading.tuple.{Fields, TupleEntry}
import com.twitter.scalding._
import scala.util.matching.Regex
class BoomerangLogJob(args: Args) extends Job(args) {
val input = TextLine(args("input"))
val output = TextLine(args("output"))
val trap = Tsv(args("trap"))
piotrbelina /
Created Jul 25, 2013
Cascading apache log parser for boomerang.js
package piotr;
import cascading.flow.Flow;
import cascading.flow.FlowDef;
import cascading.flow.hadoop.HadoopFlowConnector;
import cascading.operation.Aggregator;
import cascading.operation.aggregator.Average;
import cascading.operation.aggregator.Count;
import cascading.operation.regex.RegexFilter;
import cascading.operation.regex.RegexParser;
piotrbelina / categories.php
Created Mar 1, 2013
Magento categories export
View categories.php
* Created by JetBrains PhpStorm.
* User: piotr
* Date: 01.03.13
* Time: 16:07
* To change this template use File | Settings | File Templates.
require_once __DIR__ . '/../../../app/Mage.php';
piotrbelina /
Last active Dec 14, 2015
This is a continous deploy script for crontab.

This is a continous deploy script for crontab. To use it:

  1. Create ~/bin/ and copy script. Change mode to executable:
chmod + x ~/bin/
  1. Install crontab
piotrbelina / bootstrap.php
Created Jan 10, 2013
Bootstrap generator for Magento
View bootstrap.php
* This file is part of the Symfony package.
* (c) Fabien Potencier <>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
piotrbelina / gist:4040802
Created Nov 8, 2012
Dependency Injection using traits
View gist:4040802
class Container
protected $container = array();
public function get($name)
return $this->container[$name];
View ImageFetcher.php
class ImageFetcher
protected $url;
public function __construct()
You can’t perform that action at this time.