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 | |
/* | |
Selenium Testing Requirements: | |
- phpunit 3.7+ | |
- Selenium test case extension to PHPUnit installed with pear: | |
~ pear install phpunit/Selenium_Test_Case |
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/bash | |
if [ "$1" == "" ]; then | |
echo "Usage: $0 <database> [output-path]" | |
exit 1 | |
fi | |
TABLES=`mysql -h localhost -u someuser -p somepasswd "select TABLE_NAME from information_schema.TABLES where TABLE_SCHEMA='$1'"` | |
OUT="$2" |
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
<VirtualHost *:80> | |
ServerAdmin foo@localhost | |
ServerName foo.domain.net | |
DocumentRoot /home/foouser/project/web | |
<Directory /> | |
Options FollowSymLinks |
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 | |
class GenericSymfonyForm extends sfForm | |
{ | |
static public $choices; | |
public function configure() | |
{ | |
$this->disableCSRFProtection(); |
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 | |
define('XML_PATH', 'foodata.xml'); | |
global $rows, $record, $fdata; | |
$rows = array(); | |
echo sprintf('Reading XML...'); |
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 | |
//credit: Jon Haworth at laughing-buddha.net (I added the $asArray param) | |
function sec2hms ($sec, $padHours = false, $asArray = false) | |
{ | |
// start with a blank string | |
$hms = ""; | |
// do the hours first: there are 3600 seconds in an hour, so if we divide |
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 | |
//see helper sec2hms https://gist.github.com/4435891 | |
$start = (float) array_sum(explode(' ', microtime())); | |
$end = (float) array_sum(explode(' ', microtime())); | |
$out = sprintf('Execution time: %s %s %s', sec2hms($end - $start), PHP_EOL, PHP_EOL); |
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
# Break down values of a table by distinct field with the number of times the value occurs | |
# (e.g. breakdown of distinct users and the number of successful logins for each user) | |
SELECT session_user, COUNT( session_user ) AS NumOccurrences | |
FROM sessions | |
GROUP BY session_user | |
ORDER BY NumOccurrences DESC |
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
<html> | |
<head> | |
<script type="text/javascript" src="datatables.js"></script> | |
</head> | |
<div class="well box"> |
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 | |
/* | |
Helpers to render Bootstrap HTML for a symfony sfFormField object. | |
default input type is text | |
pass an array of field/widget names for each of the other different input types |