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 | |
function my_drupal_module_form_values($key, $form_state = array(), $default = NULL) { | |
$settings = array( | |
// Define here your form hierachies and default values | |
); | |
if (isset($form_state['values'])) { | |
$settings = array_merge($settings, $form_state['values']); | |
} | |
if (isset($form_state['storage']['my_form_root_element'])) { | |
$settings = array_merge($settings, $form_state['storage']); |
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
var cubes, list, math, num, number, opposite, race, square, | |
__slice = Array.prototype.slice; | |
number = 42; | |
opposite = true; | |
if (opposite) number = -42; | |
square = function(x) { |
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
if (event.which == null) | |
char= String.fromCharCode(event.keyCode); // old IE | |
else if (event.which != 0 && event.charCode != 0) | |
char= String.fromCharCode(event.which); // All others | |
else | |
// special key |
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
====== Sphinx on Debian/GNU Linux ====== | |
This document explains how to build Sphinx debian package from source on a [[http://debian.org/|Debian]] GNU/Linux system. | |
===== 1. Why use a Debian-specific method? ===== | |
It is easy to configure, compile and install Sphinx, but this method is not portable. | |
The Debian way is probably easier. | |
Even when building Sphinx manually, in the long run the Debian way will probably save labour, and is certainly the most reliable method. |
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 | |
// bootstrap stuff | |
define('DRUPAL_ROOT', getcwd()); | |
include_once DRUPAL_ROOT . '/includes/bootstrap.inc'; | |
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); | |
require_once DRUPAL_ROOT . '/' . variable_get('password_inc', 'includes/password.inc'); | |
// Lower than DRUPAL_HASH_COUNT to make the update run at a reasonable speed. |
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 | |
/** | |
* SplClassLoader implementation that implements the technical interoperability | |
* standards for PHP 5.3 namespaces and class names. | |
* | |
* http://groups.google.com/group/php-standards/web/final-proposal | |
* | |
* // Example which loads classes for the Doctrine Common package in the | |
* // Doctrine\Common namespace. |
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
extendStart = (func)-> | |
func ?= ()-> | |
Function::extendEnd = (args...)=> |
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 | |
$array = range(0, 100); | |
print_r($array); | |
function fizzfuzz(array $array){ | |
foreach ($array as $key => $value){ | |
$array[$key] = ''; | |
if(!($value%3)){ | |
$array[$key] .= 'Fizz'; | |
} |
OlderNewer