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 ($) { | |
Drupal.behaviors.mymodule_charts = { | |
attach:function () { | |
if (Drupal.settings.mymodule.charts) { | |
for (var chart in Drupal.settings.mymodule.charts) { | |
new Highcharts.Chart(Drupal.settings.mymodule.charts[chart]); | |
} | |
} | |
} | |
}; |
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 | |
/** | |
* Implements hook_mail_alter(). | |
* | |
* Also send pending approval mails to users who have | |
* the 'administer users' permission | |
* | |
* @see _user_mail_notify() | |
*/ |
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 | |
$response = drupal_http_request('http://placekitten.com/g/' . $width . '/' . $height); | |
if ($response->code !== 200) { | |
// If cats are sleeping, take another image generator | |
$response = drupal_http_request('http://lorempixel.com/g/' . $width . '/' . $height); | |
} | |
$destination = 'public://miaou' . $width . 'x' . $height . '.png'; | |
$file = file_save_data($response->data, $destination, FILE_EXISTS_REPLACE); |
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
/* | |
* Export selection to SVG - export_selection_as_SVG | |
* (Adapted from Layers to SVG 0.1 - export_selection_as_SVG.jsx, by Rhys van der Waerden) | |
* | |
* @author SebCorbin | |
*/ | |
// Variables | |
var ignoreHidden = true, | |
svgExportOptions = (function () { |
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
<section id="{{ block_html_id }}" class="{{ classes }} clearfix"{{ attributes }}> | |
{{ title_prefix }} | |
{% if title %} | |
<h2{{ title_attributes }}>{{ title }}</h2> | |
{% endif %} | |
{{ title_suffix }} | |
{{ content }} | |
</section> |
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 | |
/** | |
* Implements hook_page_delivery_callback_alter(). | |
*/ | |
function fixtrail_page_delivery_callback_alter(&$callback) { | |
$current_path = current_path(); | |
// Only work on normal pages, not ajax nor admin pages. | |
if ($callback != 'drupal_deliver_html_page' || path_is_admin($current_path)) { | |
return; |
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 | |
// PoneyBundle/Controller/FormController.php | |
namespace PoneyBundle\Controller; | |
use EWZ\Bundle\RecaptchaBundle\Form\Type\EWZRecaptchaType; | |
use EWZ\Bundle\RecaptchaBundle\Validator\Constraints\IsTrue; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
use Symfony\Component\Form\Extension\Core\Type\EmailType; |
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
# From http://stackoverflow.com/questions/2006351/gettext-po-files-under-version-control/11291001#11291001 | |
[diff "msgcat"] | |
textconv = msgcat --no-location --no-wrap --sort-output |
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
""" | |
Générateur de jours ouvrés français en python | |
""" | |
def easter_date(year): | |
""" | |
Calcule la date du jour de Pâques d'une année donnée | |
Voir https://github.com/dateutil/dateutil/blob/master/dateutil/easter.py | |
:return: datetime |
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
""" | |
This is a custom configuration file for pdb++, put it in home dir. | |
""" | |
import readline | |
import pdb | |
class Config(pdb.DefaultConfig): | |
filename_color = pdb.Color.lightgray | |
use_terminal256formatter = False |
OlderNewer