Skip to content

Instantly share code, notes, and snippets.

@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>
@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)
@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
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);
@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.
*/
@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
@mythz
mythz / xhr.js
Created November 2, 2011 19:05
Standalone jQuery-like Ajax Client
//Adds $.xhr and jQuery-like $.ajax methods to the prescribed namespace.
//Inspired from David Flanagans excellent cross-platform utils http://www.davidflanagan.com/javascript5/display.php?n=20-1&f=20/01.js
//Includes underscore.js _.each and _.extend methods
//modified to behave like jQuery's $.ajax(), not complete.
(function($) {
var win=window, xhrs = [
function () { return new XMLHttpRequest(); },
function () { return new ActiveXObject("Microsoft.XMLHTTP"); },
function () { return new ActiveXObject("MSXML2.XMLHTTP.3.0"); },
function () { return new ActiveXObject("MSXML2.XMLHTTP"); }
@atsuya
atsuya / browser
Created December 6, 2011 07:49
websocket binary data test - websocket-node
var socket = null;
$(function() {
socket = new WebSocket('ws://localhost:3000');
socket.binaryType = 'arraybuffer';
socket.onmessage = function(message) {
receiveBinary(message);
};
setTimeout(sendBinary, 1000);
@beberlei
beberlei / composer.json
Created December 12, 2011 10:39
A minimal Symfony Components Framework
{
"require": {
"php": ">=5.3.2",
"symfony/symfony": "2.1-dev"
}
}
@stealth35
stealth35 / BinaryFileResponse.php
Created December 13, 2011 14:04
BinaryFileResponse with X-SendFile and Date Range
<?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.
*/