Skip to content

Instantly share code, notes, and snippets.

Piotr Plenik jupeter

Block or report user

Report or block jupeter

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
jupeter / docker
Created Mar 24, 2017
Turn on Docker Remote API on Ubuntu (on port 2375)
View docker
# File: etc/default/docker
# Use DOCKER_OPTS to modify the daemon startup options.
DOCKER_OPTS="--dns --dns -H tcp:// -H unix:///var/run/docker.sock"
jupeter /
Last active Feb 21, 2019
PHPBrew for Symfony 3 on Ubuntu and Debian
# Install Requrements
apt-get install curl libxslt1-dev libreadline6-dev libmcrypt-dev libicu-dev g++ \
libcurl4-openssl-dev libssl-dev clibcurl4-openssl-dev pkg-config libssl-dev libsslcommon2-dev \
pkg-config libcurl3 autoconf libmagickwand-dev libmagickcore-dev
# Install PHPBrew (
curl -L -O; chmod +x phpbrew
sudo mv phpbrew /usr/local/bin/phpbrew
jupeter / SampleControllerTest.php
Last active Jul 28, 2016
Sample test with login
View SampleControllerTest.php
* This file is part of the MyJobCompany platform.
* © MyJobCompany
namespace tests\AppBundle\Controller;
jupeter /
Created May 23, 2016
Covert PDF to flat PDF
TEMPDIR=`mktemp -d`
gs -q -dSAFER -dBATCH -dNOPAUSE -sDEVICE=jpeg -dJPEGQ=95 -r600 -o $TEMPDIR/out-%05d.jpg $FILE
SIZES=(`identify -format "%W-%H\n" $FILE`)
View isJpeg.function.php
function isJpeg($string) {
if(ord($string[0]) != 0xFF) {
return false;
if(ord($string[1]) != 0xD8) {
return false;
$count = strlen($string);
jupeter /
Created Nov 25, 2013
Create flatten PDF file
# Script to convert PDF - create flatten PDF file
# Format:
# ./convert input-file.pdf output-file.pdf
jupeter / sfWidgetFormSelectRadioSingleable.class.php
Last active Dec 16, 2015
sfWidgetFormSelectRadioSingleable Symfony widget lets you render just one option at a time. Extends sfWidgetFormSelectRadio. Inspiration from
View sfWidgetFormSelectRadioSingleable.class.php
* This file is part of the MnumiPrint package.
* (c) Mnumi Sp. z o.o. <>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
jupeter / ssh_key_validation.php
Created Aug 3, 2012
SSH-RSA/SSH-DSA validation
View ssh_key_validation.php
public function validateKey($value)
$key_parts = explode(' ', $value, 3);
if (count($key_parts) < 2) {
return false;
View gist:2643182
* Formatter for Selenium 2 / WebDriver PHP client.
var subScriptLoader = Components.classes[";1"].getService(Components.interfaces.mozIJSSubScriptLoader);
subScriptLoader.loadSubScript('chrome://selenium-ide/content/formats/webdriver.js', this);
function useSeparateEqualsForArray() {
return true;
jupeter / New way to set the encoder.
Created Dec 31, 2011 — forked from damienalexandre/New way to set the encoder.
Playing with the Symfony2 serializer
View New way to set the encoder.
// Inside your action
$this->serializer = new \Symfony\Component\Serializer\Serializer();
$this->serializer->addNormalizer(new \Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer());
$this->serializer->setEncoder('xml', new \Symfony\Component\Serializer\Encoder\XmlEncoder());
return $this->createResponse($this->serializer->encode($page, 'xml'), 200, array('Content-Type' => 'application/xml'));
You can’t perform that action at this time.