Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Expand globs to null when there are no matches
shopt -s nullglob
# Look for either a '<subdir>/console' or a 'symfony' file
until
file=(*/console symfony); [[ -f "$file" ]] && php "$file" "$@" && exit;
do
[[ "$PWD" == "/" ]] && break;
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//
<?php
/*
* This file is part of the Assetic package.
*
* (c) Kris Wallsmith <kris.wallsmith@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@pgodel
pgodel / nginx-php-config-sample
Created July 17, 2011 16:19
nginx php config sample
server {
set $website_host "mywonderfulwebsite.org";
set $website_root "/var/www/mywonderfulwebsite/web";
set $default_controller "index.php";
set $symfony_root "/var/www/mywonderfulwebsite/lib/vendor/symfony";
listen 80;
server_name $website_host;
# Gzip
@havvg
havvg / bdd-experiment-guide.md
Created September 9, 2011 14:44
Behavior Driven Development in Symfony2 with Behat, Mink and Zombie.js
@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
@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:

@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;
@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
@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.
//