Skip to content

Instantly share code, notes, and snippets.

@asm89
asm89 / gist:5797852
Last active December 18, 2015 14:29
Rerun PHPUnit on file changes in a given dir (defined in my .bashrc)
# watch files and rerun phpunit on changes
phpunitwait() {
while inotifywait $(find $1 -name '*.php');
do
clear;
phpunit --colors $2;
done;
}
@jedi4ever
jedi4ever / dns tuning ssh login speedup vagrant
Created May 27, 2013 13:37
speeding up DNS/SSH connections in vagrant
- Tune /etc/ssh/sshd_config
UseDNS no # Disable DNS lookups
GSSAPIAuthentication no # Disable negotation of slow GSSAPI
don't forget to restart it, use a script provider to set it , or create it with veewee or snapshot it
- Tune Vagrantfile
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
@nikic
nikic / php-5.5-features.md
Last active August 31, 2020 10:39
List of new features in PHP 5.5
#!/bin/sh
_complete_console() {
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
console="${COMP_WORDS[0]}"
cmds=` ${console} | tail -n +6 | grep '^ ' | awk '{ print $1 }' `
@boutell
boutell / checkhyperthreads.php
Created October 4, 2012 14:12
Check distribution of fastcgi processes over the hyperthreads and cores of your server
<?php
// Are your fastcgi processes spread out evenly over the available hyperthreads on your server?
// This script will tell you.
//
// If your php-cgi process is not /usr/local/bin/php-cgi, tweak accordingly.
//
// In my experience they do tend to distribute pretty well over time, but see also
// assignhyperthreads.php.
//
@jmikola
jmikola / FindInvalidReferencesCommand.php
Created July 27, 2012 21:47
Find invalid references among Doctrine MongoDB ODM documents
<?php
namespace Acme\FooBundle\Command;
use Doctrine\Common\Persistence\ManagerRegistry;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class FindInvalidReferencesCommand extends ContainerAwareCommand
@immutef
immutef / TestCommand.php
Created December 10, 2011 12:56
ZeroMQ Fan In/Out + Kill
<?php
/**
* I'd like to use IPC sockets (ipc://foo.ipc) but my virtual machine won't let me ... :)
* IPC sockets will be faster than TCP, so this script could run even faster than it does!
*/
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputOption;
@mbbx6spp
mbbx6spp / README.md
Created December 4, 2011 04:24
Best UNIX shell-based tools I can't live without with example usages

Best UNIX Shell tools

These are a list of usages of shell commands I can't live without on UNIX-based systems.

Install

Mac OS X

Using Homebrew (yes, I am opinionated) you can install the following tools with the following packages:

@pgodel
pgodel / deploy.rb
Created November 28, 2011 16:15 — forked from jakzal/deploy.rb
Updating assets version before assetic dump (capifony)
namespace :symfony do
namespace :assets do
desc "Updates assets version"
task :update_version do
run "sed -i 's/\\(assets_version: \\)\\(.*\\)$/\\1 #{real_revision}/g' #{latest_release}/app/config/config.yml"
end
end
end
before "symfony:assetic:dump" do
@havvg
havvg / bdd-experiment-guide.md
Created September 9, 2011 14:44
Behavior Driven Development in Symfony2 with Behat, Mink and Zombie.js