I hereby claim:
- I am mattfarina on github.
- I am mattfarina (https://keybase.io/mattfarina) on keybase.
- I have a public key whose fingerprint is D65A 0E4F 7836 7744 2D69 3D55 DC66 5B26 7D74 FD99
To claim this, I am signing this object:
<?php | |
use OpenStack/OpenStack; | |
$options = array( | |
'endpoint' => 'https://example.identity.com/v2.0/', | |
'username' => 'awesomesauce', | |
'password' => 'cakeplease', | |
); |
I hereby claim:
To claim this, I am signing this object:
// Provide credentials | |
$settings = array( | |
'username' => USERNAME, | |
'password' => PASSWORD, | |
'tenantid' => YOUR_TENANT_ID, | |
'endpoint' => IDENTITY_SERVICES_URL, | |
'transport' => '\HPCloud\Transport\PHPStreamTransport', | |
); | |
Bootstrap::setConfiguration($settings); |
(function($) { | |
// | |
// Automatically calls all functions in APP.init | |
// | |
jQuery(document).ready(function() { | |
APP.go(); | |
}); | |
// | |
// Module pattern: |
/** | |
* Helper function; removes all required element flags on a section of a form. | |
* | |
* @param array $element | |
* A form or section of a form. | |
* | |
* @return array | |
* A section of a form tree with #required = 0 everyehere. | |
*/ | |
function example_remove_required($element) { |
function checkPlain(str) { | |
var length, | |
r = new RegExp('(&)|(\")|(<)|(>)|([^&\"<>]*)', 'g') | |
replacements = ["&", """, "<", ">"], | |
retval = '', | |
match = r.exec(str); | |
while (match[0] != "") { | |
length = match.length; | |
for (var i = 1; i < length; ++i) { | |
if (match[i] != undefined) { |
// Here we use a similar set of variables passed in as jQuery. The lone difference is | |
// the inclusion of the Drupal variable. We pass in the global variables we use which | |
// provides proper dependency injection and for compressors to have names that can be | |
// more easily shrunk. | |
(function($, Drupal, window, document, undefined) { | |
Drupal.sitetheme = Drupal.sitetheme || {}; | |
/* | |
* Initialize placeholder functionality on a text based input element. |
$.support.positionFixed = (function () { | |
var el, support, | |
body = document.body || document.getElementsByTagName("body")[0] || document.documentElement; | |
// Boolean indicating whether or not "position: fixed" is supported. | |
// Using the DOM to create an element is much faster than using jQuery. | |
el = document.createElement("div"); | |
el.style.position = "fixed"; | |
el.style.top = "10px"; | |
el.style.visibility = "hidden"; |
function custom_tokens_alter(array &$replacements, array $context) { | |
$options = $context['options']; | |
$sanitize = !empty($options['sanitize']); | |
if ($context['type'] == 'node' && !empty($context['data']['node'])) { | |
$node = $context['data']['node']; | |
foreach ($context['tokens'] as $name => $original) { | |
switch ($name) { | |
case 'title': | |
$title = !empty($options['pathauto']) ? strip_tags($node->title) : $node->title; |