Skip to content

Instantly share code, notes, and snippets.


Jonathan Petitcolas jpetitcolas

View GitHub Profile
jpetitcolas / Finding all test files not included in PHPUnit
Last active Aug 29, 2015
Finding all test files not included in PHPUnit testsuite
View Finding all test files not included in PHPUnit
find src/ -type f -name *Test.php -exec grep -H -c "@group" {} \; | grep :0\$ | awk -F':' '{ print $1 }'
jpetitcolas / Split big files into several smaller
Created Mar 24, 2014
Split a big file into several parts with Linux
View Split big files into several smaller
# Splitting file into smaller parts
split --bytes=512M bigfile prefix
# Joining all file parts
cat prefix* > bigfile
jpetitcolas /
Created Apr 2, 2014
Cleaning all Docker containers and images
sudo docker stop $(sudo docker ps -a -q)
sudo docker rm $(sudo docker ps -a -q)
sudo docker rmi $(sudo docker images -a -q)
jpetitcolas / issue.php
Last active Aug 29, 2015
Issue with Document Manager
View issue.php
// Controller
$tag = new Tag();
$this->getContainer()->get('my_service')->import($content, $tag);
// Service
jpetitcolas / Makefile
Created Jan 27, 2015
Playing with websockets in Go
View Makefile
docker run \
--rm \
--volume="`pwd`:/srv" \
--tty \
--interactive \
--publish="8080:8080" \
marmelab/go run src/marmelab/gollabedit/*.go
View Application.js
import View from "./folder/View";
class Application {
constructor() {
this.view = new View("I'm a view!");
sayHello() {
jpetitcolas /
Created Sep 19, 2015
Dump a Docker-ized database to Amazon S3
# @see
# Configuration
FILENAME="awesomeproject-`date +%Y-%m-%d-%H:%M:%S`.sql"
jpetitcolas / couvent.js
Created Sep 22, 2015
Only French would understand this lib... ;)
View couvent.js
// couvent.js - MIT license'*')).forEach(function (el) { = 'none';
jpetitcolas / read-only-on-select-list.js
Created Dec 28, 2012
A short snippet to simulate read-only attribute on a select list, which is currently not W3C-compliant. We can not just disable it, as a disabled input is not sent when submitting a form. The trick here is to store the disabled select value into a hidden field.
View read-only-on-select-list.js
* Simulate the read-only attribute on a select list (as it is not normalized).
* @see
* @param Object Select list element
function setReadOnlyOnSelect(selectList)
// Ensure selectList exists
if(!selectList.length) {
console.warn("Unable to find specified select list.");
You can’t perform that action at this time.