Skip to content

Instantly share code, notes, and snippets.

<?php
$range = range(1, $rc);
$qs = implode(',', array_fill(0,$rc, '?'));
$titleQuery = $db->prepare('SELECT tablename_id, tablename_title, table_type, table_attribute FROM tablename WHERE tablename_id IN (' . $qs . ') ORDER BY tablename_title;');
$titleQuery->execute($range);
$tableNames = $titleQuery->fetchAll(PDO::FETCH_ASSOC);
//$rc is a variable that stores the row count of the particular table
foreach($tableNames as $tablename_data) {
<?php
$routes = array(
'routeA' => array(
//config here
)
);
$routes['routeB'] = $routes['routeA'];
$config = array(
<?php
return [
'/userid=[0-9]{1,3}/' => 'user'
];
{
init: function(elevators, floors) {
for (var idx in elevators) {
elevators[idx].on('floor_button_pressed', function(floornum) {
if (this.destinationQueue.indexOf(floornum) === -1) {
this.destinationQueue.push(floornum);
this.destinationQueue.sort();
this.checkDestinationQueue();
}
});
<?php
/**
* Hydrate an object by populating public properties
*
* Hydrates an object by setting public properties of the object.
*
* @param array $data
* @param object $object
* @return object
add_filter("gform_address_types", "uk_address", 10, 2);
function uk_address($address_types, $form_id)
{
$address_types["uk"] = array(
"label" => "UK",
"country" => "United Kingdom",
"zip_label" => "Postcode",
"state_label" => "County",
"states" => array(
@BinaryKitten
BinaryKitten / index.html
Created July 16, 2014 10:52
jQuery List Toggler
<div class="speech-l">
<h4>Brands</h4>
<ul>
<li><a class="all" href="#">Hello</a>
</li>
<li><a class="all" href="#">Joe Rocket <em>(57)</em></a>
</li>
@BinaryKitten
BinaryKitten / index.html
Created July 16, 2014 10:52
Native List toggler
<div class="speech-l">
<h4>Brands</h4>
<ul>
<li><a class="all" href="#">Hello</a>
</li>
<li><a class="all" href="#">Joe Rocket <em>(57)</em></a>
</li>
<?php
protected function _initModules()
{
$moduleAutoloader = new Zend_Application_Module_Autoloader(array(
'namespace' => '',
'basePath' => APPLICATION_PATH . '/modules/default'
));