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 | |
use Symfony\Component\Translation\TranslatorInterface; | |
function format(\DateTime $date, TranslatorInterface $translator) | |
{ | |
$diff = date_create()->diff($date); | |
$seconds = $diff->days * 86400 + $diff->h * 3600 + $diff->i * 60 + $diff->s; | |
$format = $translator->transChoice('reldate', $seconds); |
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
# artist api | |
artist: | |
url: /artist/* | |
param: { module: artist, action: methodSwitch } | |
# info api | |
info: | |
url: /info/* | |
param: { module: info, action: methodSwitch } | |
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 | |
/** | |
* Extended action class for adding json rendering functionality. | |
* | |
* @author Phil Moorhouse <[email protected]> | |
* @package tlv4 | |
* @subpackage api | |
*/ | |
class tlApiActions extends sfActions | |
{ |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
</head> | |
<body> | |
<?php echo $sf_content ?> | |
</body> |
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 var_dump($data); ?> |
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 | |
/** | |
* Extended version of sfWebBrowser to provide caching functionality | |
*/ | |
class tlCachedBrowser extends sfWebBrowser | |
{ | |
protected $cache_expiration = 86400; // 1 day default cache | |
/** |
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
class ProjectConfiguration extends sfProjectConfiguration | |
{ | |
public function configureDoctrine(Doctrine_Manager $manager) | |
{ | |
require_once sfConfig::get('sf_lib_dir') . '/../lib/cache/gyDoctrineCacheApc.class.php'; | |
$cacheDriver = new gyDoctrineCacheApc(); | |
$cacheDriver->setNamespace(md5(sfConfig::get('sf_root_dir'))); | |
$manager->setAttribute(Doctrine_Core::ATTR_QUERY_CACHE, $cacheDriver); |
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 | |
//Deletes all CSS classes and id's, except for those listed in the array below | |
function custom_wp_nav_menu($var) { | |
return is_array($var) ? array_intersect($var, array( | |
//List of allowed menu classes | |
'current_page_item', | |
'current_page_parent', | |
'current_page_ancestor', | |
'first', | |
'last', |
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
__author__ = 'kersten.clauss' | |
"""Benchmark different GeoTiff compression algorithms. | |
Usage: GTiff_compression_benchmark.py some_geo.tif | |
Requires the GDAL tools to be present and executable from the command line of your system. | |
This script will take a GeoTiff as input and create copies with different compression algorithms from it. | |
It measures the filesize, compression and decompression times and returns them as a table. |
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
$ = jQuery; | |
/* | |
* jQuery BBQ: Back Button & Query Library - v1.3pre - 8/26/2010 | |
* http://benalman.com/projects/jquery-bbq-plugin/ | |
* | |
* Copyright (c) 2010 "Cowboy" Ben Alman | |
* Dual licensed under the MIT and GPL licenses. | |
* http://benalman.com/about/license/ | |
*/ |
OlderNewer