This file contains 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 | |
$data = array( | |
'Collections' => array( | |
'id' => 1, | |
'name' => 'Countries', | |
), | |
// sorted by group,name from the SQL | |
'CollectionItems' => array( | |
array( 'id' => 1, 'collection_id' => 1, 'name' => 'CountryName', 'value' => 'Cyprus', 'group' => 1,), |
This file contains 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 | |
// Keep bumping up in powers of two | |
define('LANG_LIST_VISIBLE', 1); | |
define('LANG_LIST_HIDDEN', 2); | |
define('LANG_LIST_BOTH', 4); | |
print "\nBoth\n"; | |
print_r(getSupportLanguages(LANG_LIST_BOTH)); |
This file contains 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 | |
/* | |
* If we are being called as Ajax content provider, just print | |
* something out, based on passed parameters. Sleep for more | |
* obvious results. | |
*/ | |
if (!empty($_REQUEST['widget']) && !empty($_REQUEST['id'])) { | |
$config = $_REQUEST['widget'] . '-' . $_REQUEST['id']; | |
switch($config) { | |
case 'text-one': |
This file contains 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 | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php | |
*/ | |
$args = array( |
This file contains 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 | |
/** | |
* Quick proof of concept for feature management | |
*/ | |
class Feature { | |
/** | |
* This is where we keep the list of features | |
*/ | |
protected $features; |
This file contains 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 | |
// Nested array to sort | |
$data = array( | |
'Guy' => array( | |
array('id' => 1, 'title' => 'This'), | |
array('id' => 7, 'title' => 'Boo'), | |
array('id' => 9, 'title' => 'Boo'), | |
array('id' => 3, 'title' => 'Broken'), | |
), |
This file contains 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 | |
// Data CSV file | |
$fileName = 'data.csv'; | |
// Try to open the CSV file | |
$fh = fopen($fileName, 'r'); | |
if (!is_resource($fh)) { | |
die("Failed to open $fileName"); | |
} |
This file contains 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 | |
$obj = new FileFinder($argv[1]); | |
$obj->setFileType(array_slice($argv, 2)); | |
$obj->setExcludingDirectories(array('test1')); | |
$pages = $obj->find(); | |
print_r($pages); | |
class FileFinder { |
This file contains 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 | |
/* For this whole thing to work, you'll need at least these fields in your | |
* articles table: | |
* | |
* - id (article id) | |
* - parent_id (to link drafts to parent article) | |
* - slug (for friendly URLs usually) | |
* - title (obviously) | |
* - content (obviously) |
This file contains 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
<!-- so it turns out that the object tag can act like an iframe | |
but the cool thing is you can nest object tags inside eachother for a fallback path. | |
what this means is you can "objectframe" a site.. and if it fails.. (site down, offline, whatever).. it'll use the next one. | |
so you can objectframe the live site and fallback to a screenshot. | |
or something. | |
demo at : http://jsfiddle.net/paul/CY2FQ/1/ | |
--> |
OlderNewer