Skip to content

Instantly share code, notes, and snippets.

View ValentinMerlet's full-sized avatar

Valentin Merlet ValentinMerlet

  • Akeneo
  • Nantes
View GitHub Profile
@KamilLelonek
KamilLelonek / hipster.js
Created October 24, 2014 21:33
Hipster JavaScript usages
// Boring
if (success) {
obj.start();
} else {
obj.stop();
}
// Hipster-fun
var method = (success ? 'start' : 'stop');
obj[method]();
@JustAdam
JustAdam / drupal_taxonomy_content_type.php
Created August 2, 2012 09:49
Drupal 7 - Programmatically create a taxonomy and attach a field to it, then create a content type and attach that taxonomy to it.
<?php
// Machine name for our custom node
define('NODE_NAME', 'the_node_machine_name');
// Machine name for our custom taxonomy
define('TAXONOMY_NAME', 'the_taxonomy_machine_name');
function module_install() {
_create_taxonomy();
_create_content_type();
}