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 | |
define('DRUPAL_ROOT', getcwd()); | |
require_once DRUPAL_ROOT . '/Twig/lib/Twig/Autoloader.php'; | |
Twig_Autoloader::register(); | |
// Almost empty class, just swaps Twig_Node_Print objects to Drupal_Twig_Node_Print objects. | |
class Drupal_Twig_NodeVisitor implements Twig_NodeVisitorInterface { | |
function enterNode(Twig_NodeInterface $node, Twig_Environment $env) { |
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
function presave() { | |
module_invoke_all('config_presave', $this); | |
$hook = 'config_presave'; | |
$part = strtok($this->name, '.'); | |
do { | |
$hook .= '_' . $part; | |
module_invoke_all($hook, $this); | |
} while ($part = strtok('.')); | |
} |
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 | |
class DummyFilter extends PHP_User_Filter | |
{ | |
private $_data; | |
/* Called when the filter is initialized */ | |
function onCreate( ) | |
{ |
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
Index: apc.c | |
=================================================================== | |
--- apc.c (revision 326528) | |
+++ apc.c (working copy) | |
@@ -34,6 +34,7 @@ | |
#include "apc.h" | |
#include "apc_zend.h" | |
#include "apc_cache.h" | |
+#include "apc_globals.h" | |
#include "php.h" |
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
if (!isset($input)) { | |
if (!empty($element['#default_value'])) { | |
$element['#needs_validation'] = TRUE; | |
} | |
$element['#has_garbage_value'] = TRUE; | |
} | |
if ($input === FALSE && !isset($element['#default_value']))) { | |
$element['#has_garbage_value'] = TRUE; | |
} |
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\HttpFoundation\JsonResponse; | |
function btest_menu() { | |
$items['btest'] = array( | |
'type' => MENU_CALLBACK, | |
'access callback' => TRUE, | |
'page callback' => 'btest_page', | |
); |
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
apt-get update | |
aptitude install -y apache2 libonig2 libqdbm14 libxml2 apache2-mpm-prefork ucf libicu44 mysql-server libjpeg62 libpng12-0 libt1-5 libxpm4 git-core autoconf automake libssl-dev libtool shtool make | |
service mysql stop | |
sed -i 's/\/var\/lib\/mysql/\/dev\/shm\/mysql/g' /etc/mysql/my.cnf | |
sed -i '/en_US/a skip_innodb' /etc/mysql/my.cnf | |
mysql_install_db | |
service mysql start | |
echo ServerName localhost > /etc/apache2/httpd.conf | |
cd /etc/apache2/mods-enabled | |
ln -s ../mods-available/rewrite.load |
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
<VirtualHost *:80> | |
ServerAdmin webmaster@localhost | |
DocumentRoot /var/www | |
<Directory /var/www/> | |
Options Indexes FollowSymLinks MultiViews | |
AllowOverride All | |
Order allow,deny | |
allow from all | |
</Directory> |
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 | |
$dir = getcwd(); | |
foreach (file('/usr/local/etc/baseline.csv') as $row) { | |
list($k, $v) = explode(',', trim($row)); | |
$a[$k] = (int)$v; | |
} | |
$a = array_reverse($a); | |
$bins[] = array('sum' => 0, 'data' => array()); | |
foreach ($a as $name => $time) { |
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
system.method.set_key = event.download.finished,done,"execute=/usr/local/bin/run.sh,$d.get_name=;d.set_directory=/var/www" | |
schedule = watch_directory,1,1,load_start=/root/torrent/watch/*.torrent |
OlderNewer