As extracted from keystone.js utils
/**
* Copies and merges options with defaults.
*
* @param {Object} defaults
* @param {Object} options
* @return {Object} the options argument merged with defaults| -has:userlabels -in:sent -in:chat -in:draft -in:inbox -in:bin |
As extracted from keystone.js utils
/**
* Copies and merges options with defaults.
*
* @param {Object} defaults
* @param {Object} options
* @return {Object} the options argument merged with defaultsPOST file contents as attachment to an endpoint
curl -X "POST" -i -F filedata="@test/data/fake_users_api.json" http://localhost:3000/api/v1/users/uploadBulk`
| /** | |
| * Using nconf to manage hierarchical configuration | |
| * https://www.npmjs.com/package/nconf | |
| */ | |
| 'use strict'; | |
| var nconf = require('nconf'); | |
| var config = { |
| <?php | |
| function calc_aspect_ratio($w=0,$h=0,$image_dimensions=array()){ | |
| //work out some ratios for the resized dimensions | |
| if($w){ | |
| $w_ratio=$w/$image_dimensions[0]; | |
| } else { | |
| $w_ratio=1; | |
| } | |
| if($h){ | |
| $h_ratio=$h/$image_dimensions[1]; |
hook_inline_entity_form_table_fields_alter(&$fields, $context) to customise the way it looks in the CMS form| <?php | |
| function make_node_programmatically()($title) { | |
| global $user; | |
| $node = new stdClass(); // We create a new node object | |
| $node->type = "pages"; // Or any other content type you want | |
| $node->title = $title; | |
| $node->language = LANGUAGE_NONE; | |
| node_object_prepare($node); // Set some default values. | |
| $node->uid = $user->uid; // Or any id you wish | |
| $node = node_submit($node); // Prepare node for a submit |
| //define a module that returns a noConflict version of jQuery | |
| define(['jquery'], function (jq) { | |
| return jq.noConflict( true ); | |
| }); |
| <?php | |
| new ThemeName(); | |
| class ThemeName { | |
| /** | |
| * Starting off… | |
| */ | |
| function __construct() { | |
| //add_editor_style(); |