This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
run: | |
docker run \ | |
--rm \ | |
--volume="`pwd`:/srv" \ | |
--tty \ | |
--interactive \ | |
--publish="8080:8080" \ | |
marmelab/go run src/marmelab/gollabedit/*.go |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"encoding/binary" | |
"fmt" | |
"log" | |
"os" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Based on http://nrocco.github.io/2012/04/19/git-pre-commit-hook-for-PHP.html post | |
# | |
# Do not forget to: chmod +x .git/hooks/pre-commit | |
BAD_PHP_WORDS='var_dump|die|todo' | |
BAD_TWIG_WORDS='{{ dump(.*) }}' | |
EXITCODE=0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Controller | |
$tag = new Tag(); | |
$dm->persist($tag); | |
$dm->flush(); | |
$this->getContainer()->get('my_service')->import($content, $tag); | |
// Service |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo docker stop $(sudo docker ps -a -q) | |
sudo docker rm $(sudo docker ps -a -q) | |
sudo docker rmi $(sudo docker images -a -q) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Splitting file into smaller parts | |
split --bytes=512M bigfile prefix | |
# Joining all file parts | |
cat prefix* > bigfile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sed '$!N;s/\n/ /' infile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find src/ -type f -name *Test.php -exec grep -H -c "@group" {} \; | grep :0\$ | awk -F':' '{ print $1 }' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Install common environment | |
apt-get update | |
apt-get install -y curl | |
# Install Git and configure it (useful when working on Windows) | |
apt-get install -y git-core | |
git config --global color.ui auto | |
git config --global core.filemode false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysqldump --opt --where="1 limit 1000000" database table > dump.sql |