Skip to content

Instantly share code, notes, and snippets.

@igorw
igorw / gist:1211383
Created September 12, 2011 14:26 — forked from anonymous/gist:1211382
compass setup
sudo apt-get install ruby rubygems
sudo gem install compass
cd Desktop/techup-mobile/lib/touch/resources/sass
/var/lib/gems/1.8/bin/compass watch
@johnwards
johnwards / MessageLogger.php
Created August 1, 2011 11:14
Testing Swiftmailer in a Silex app
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php
index b29e279..3adec08 100644
--- a/phpBB/includes/db/dbal.php
+++ b/phpBB/includes/db/dbal.php
@@ -346,7 +346,7 @@ class dbal
}
else
{
- $values[] = $this->_sql_validate_value($var);
+ $values[] = $this->_sql_validate_value($var, $key);
@nrk
nrk / 00_LICENSE
Created May 9, 2011 19:22
Streaming responses with Silex.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <[email protected]>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@ezzatron
ezzatron / clean-use.php
Created May 9, 2011 12:10
Script to clean unnecessary PHP use statements
#!/usr/bin/env php
<?php
$paths = array();
if (isset($_SERVER['argv']))
{
$paths = $_SERVER['argv'];
array_shift($paths);
if (!$paths)
@craigmarvelley
craigmarvelley / Web.config
Created May 8, 2011 20:36
Silex IIS Web.config
<?xml version="1.0"?>
<configuration>
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="index.php" />
</files>
</defaultDocument>
@weaverryan
weaverryan / Makefile
Created May 5, 2011 11:36
Example sphinx configuration for rendering the symfony docs
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build -c .
PAPER =
BUILDDIR = build
SOURCE = source
@skremiec
skremiec / index.php
Created April 12, 2011 17:42
Silex problem
This code works perfectly on two different servers (running PHP 5.3.2 and PHP 5.3.3).
Unfortunately it fails on the third one (PHP 5.3.4).
On very first request, just after downloading silex.phar, it produces:
Fatal error: Class 'Silex\Application' not found in /home/users/abc/public_html/index.php on line 7
And any following request ends with:
Fatal error: Uncaught exception 'PharException' with message '__HALT_COMPILER(); must be declared in a phar' in /home/users/abc/public_html/silex.phar:8
@beberlei
beberlei / form_definitions.php
Created March 17, 2011 12:30
This Symfony Form Experimental Branch example does not use the DIC.
<?php
class MyFormType extends AbstractFormType
{
public function configure(FormBuilder $builder, array $options)
{
$builder->setDataClass("MyProject\FooEntity");
$builder->add('my.sub_form');
$builder->add('text', 'name', array('max_length' => 127, 'id' => 'foo'));
$builder->add('date', 'created');
@p
p / gist:865826
Created March 11, 2011 12:20
Flush poc
<?php
header('Content-Length: 6');
echo('before');
flush();
sleep(4);
echo('after');