Skip to content

Instantly share code, notes, and snippets.

@pascalduez
pascalduez / html.tpl.php
Created December 1, 2011 16:18
Drupal 7 — HTML5 html.tpl.php
<!DOCTYPE html>
<html<?php print $html_attributes; ?>>
<head>
<?php print $head; ?>
<title><?php print $head_title; ?></title>
<?php print $styles; ?>
<?php print $scripts; ?>
</head>
<body<?php print $body_attributes;?>>
@pascalduez
pascalduez / html.tpl.php
Created December 1, 2011 16:47
Drupal 7 — Move $scripts at page bottom
<!DOCTYPE html>
<html<?php print $html_attributes; ?>>
<head>
<?php print $head; ?>
<title><?php print $head_title; ?></title>
<?php print $styles; ?>
<?php print $head_scripts; ?>
</head>
<body<?php print $body_attributes;?>>
@pascalduez
pascalduez / demo.js
Created December 24, 2011 11:49
Drupal 7 — Basic Ajax request (manual)
/**
* @file demo JS.
* jQuery 1.5+
*/
(function( $ ) {
// On DOM ready
$(function() {
@pascalduez
pascalduez / demo.module
Created December 24, 2011 14:01
Drupal 7 — Basic Ajax request (Ajax framework)
<?php
/**
* @file
* Demo module, Basic Ajax request (Ajax framework).
*/
/**
* Implements hook_menu().
*/
@pascalduez
pascalduez / demo.module
Created December 24, 2011 15:02
Drupal 7 — Basic Ajax form submit (Ajax framework)
<?php
/**
* @file
* Demo module, Basic Ajax form submit (Ajax framework).
*/
/**
* Implements hook_menu().
*/
@pascalduez
pascalduez / Fetch.sublime-settings
Created February 17, 2012 22:24 — forked from dustinhorton/Fetch.sublime-settings
fetch settings for sublime text 2
{
"files":
{
"backbone": "https://raw.github.com/documentcloud/backbone/master/backbone.js",
"history": "https://raw.github.com/balupton/history.js/master/scripts/compressed/history.js",
"jquery": "http://code.jquery.com/jquery.js",
"jquery-cookie": "https://raw.github.com/carhartl/jquery-cookie/master/jquery.cookie.js",
"jquery-dotimeout": "https://raw.github.com/cowboy/jquery-dotimeout/master/jquery.ba-dotimeout.min.js",
"jquery-extra-selectors": "https://raw.github.com/keithclark/JQuery-Extended-Selectors/master/jquery-extra-selectors.js",
"jquery-flexslider": "https://raw.github.com/mbmufffin/FlexSlider/master/jquery.flexslider-min.js",
@pascalduez
pascalduez / modulename.module
Created February 22, 2012 23:33
Drupal 7 - Add a cancel button on node forms
<?php
/**
* Implements hook_form_alter().
*/
function modulename_form_alter(&$form, &$form_state, $form_id) {
// You might want to filter by content type.
if ($form_id == 'ctype_node_form') {
// Add a cancel button.
$form['actions']['cancel'] = array(
@pascalduez
pascalduez / webcamlapse.js
Created November 6, 2012 22:41
Webcam auto timelapse
#!/usr/bin/env node
var http = require('http')
, url = require('url')
, path = require('path')
, fs = require('fs')
, async = require('async')
, exec = require('child_process').exec
, imgUrl
, options
@pascalduez
pascalduez / template.tpl.php
Last active December 22, 2015 01:39
Drupal 7 — Default page template with panels
<?php
/**
* Helper function to test for panel page config.
*/
function _is_panel_page() {
$page = &drupal_static(__FUNCTION__);
if (function_exists("page_manager_get_current_page")) {
if (!isset($page)) {
@pascalduez
pascalduez / doNotTrack.md
Last active October 27, 2017 09:05
Do Not Track

Do Not Track

Implementations across browsers and JavaScript access.

Chrome

window.navigator.doNotTrack

setting: "Send a ‘Do Not Track’ request with your browsing traffic"
return: [ "1" or null ]