Skip to content

Instantly share code, notes, and snippets.

View alnutile's full-sized avatar

Alfred Nutile alnutile

View GitHub Profile
/**
* Registers the autoloader for all third-party packages.
*/
function composer_manager_register_autoloader() {
static $registered = FALSE;
if (!$registered) {
$autoloader = composer_manager_vendor_dir() . '/autoload.php';
if (!file_exists($autoloader)) {
$message = t('Autoloader not found: @file', array('@file' => $autoloader));
throw new \RuntimeException($message);
@alnutile
alnutile / gist:7090406
Created October 21, 2013 20:27
settings.php
$databases = array (
'default' => array (
'default' =>
array (
'database' => 'drupalDatabase',
'username' => 'username',
'password' => 'password',
'host' => '127.0.0.1',
'port' => '',
'driver' => 'mysql',
@alnutile
alnutile / test.html
Created October 29, 2013 19:07
Example needs tons of work though
<script type="text/javascript">
jQuery(document).ready(function(){
Drupal.settings.lang = {};
Drupal.settings.lang.test1 = "test1";
Drupal.settings.lang.test2 = "test2";
console.log(janrain.settings.language);
if(janrain.settings.language == 'en-US') {
console.log("Language matches");
/**
* Re-apply superscript to registered-mark after Gardens removes them.
*/
jQuery(document).ready(function ($) {
var replaceCharacters = function(target) {
var pagerButtonTxt = '';
var pagerButtonTxt = $(target).html().
replace(/&reg;/gi, '<sup>&reg;</sup>').
@alnutile
alnutile / example.html.erb
Created November 17, 2013 15:13
Look for other partial to pul in
<% if path.split('/').include?("edit") || path.split('/').include?("add") %>
<%= yield %>
<% else %>
<%= render "#{path}/main", :path => path, :settings => settings %>
<% end %>
// Then the "answer" field should contain "8.9"
$form['questions']['should_see_value']['form_field_css'] = array(
'#type' => 'textfield',
'#title' => t('Then the'),
'#name' => 'form_field_css',
'#attributes' => array(
'class' => array('col-mg-12', 'should_see_value_group'),
'data-type' => array('textfield'),
'placeholder' => t('the name|id|label of the field'),
),
@alnutile
alnutile / test.php
Created November 25, 2013 19:34
Set to validate true
$form['results_area']['settings']['os_browser']['os'] = array(
'#type' => 'select',
'#options' => array('Windows 2012' => 'Windows 2012'),
'#default_value' => 'Windows 2012',
'#validated' => TRUE,
'#description' => t('What OS and Browser should be used for this test')
);
$form['results_area']['settings']['os_browser']['browser'] = array(
'#type' => 'select',
$form['questions'] = array(
'#type' => 'fieldset',
'#title' => t('<i class="glyphicon glyphicon-arrow-down"></i>Build your test using Steps below'),
'#attributes' => array('class' => ''),
'#weight' => -100,
'#collapsible' => FALSE,
'#collapsed' => FALSE,
);
@alnutile
alnutile / behat.yml
Created December 17, 2013 15:21
example mobile yml
iPad:
context:
class: 'FeatureContext'
extensions:
Behat\MinkExtension\Extension:
base_url: 'https://saucelabs.com'
javascript_session: 'selenium2'
goutte:
selenium2:
browser: ipad
@alnutile
alnutile / behat.yml
Created December 18, 2013 12:54
timeout settings
default:
paths: { features: features, bootstrap: /Users/alfrednutile/Drupal/behatpfizer/site/sites/all/modules/custom/behat_editor/behat/features/bootstrap/FeatureContext.php }
extensions: { Behat\MinkExtension\Extension: { goutte: null, selenium2: null, base_url: 'http://behateditor.localvm.com', browser_name: safari, javascript_session: selenium2 }, Drupal\DrupalExtension\Extension: { blackbox: null, subcontexts: { paths: [/Users/alfrednutile/Drupal/behatpfizer/site/sites/all/modules/] } } }
saucelabs:
context: { class: FeatureContext }
extensions: { Behat\MinkExtension\Extension: { default_session: selenium2, selenium2: { browser: 'internet explorer', wd_host: 'test:[email protected]/wd/hub', capabilities: { command_timeout: 600, platform: 'Windows 2012', browser: 'internet explorer', version: '10', name: 'Behat Tests ' } } } }