Skip to content

Instantly share code, notes, and snippets.

View dbarbar's full-sized avatar

David Barbarisi dbarbar

View GitHub Profile
@dbarbar
dbarbar / setup_codebase.sh
Last active August 29, 2015 13:57
Set up springboard code base for development work.
#!/bin/bash
rm -rf src
rm -rf build
git clone [email protected]:JacksonRiver/Springboard-Build.git build
drush make build/springboard-mtsb.make src
cp -f settings.php src/sites/default
#!/bin/bash
rm -rf box
git clone [email protected]:dbarbar/sb4dev.git box
cd box
vagrant up --provider=vmware_fusion
cd ..
rm -rf files
@dbarbar
dbarbar / upsellCept.php
Created August 28, 2014 15:39
Example codeception acceptance test for the fundraiser upsell happy path
<?php
$I = new AcceptanceTester($scenario);
$I->wantTo('complete an upsell.');
$I->amOnPage('/');
$I->see('DONATE');
$I->fillField('First Name', 'Your');
$I->fillField('Last Name', 'Mom');
$I->fillField('E-mail address', '[email protected]');
$I->fillField('Address', '1234 main st');
$I->fillField('City', 'Washington');
@dbarbar
dbarbar / realantivirus.sh
Created September 4, 2014 16:12
Definitely not a fake antivirus program for mac and linux to ensure PCI compliance.
#!/bin/sh
# Software must have the ability to auto-update itself and virus definitions as well as log scan results.
#
# Don't read below this line.
echo 'Auto updating.'
sleep 30
echo 'Updaing virus definitions.'
[drush] Executing 'drush --account-name=admin --account-pass=admin [email protected] --clean-url=1 [email protected] --site-name=4x --nocolor --root=/var/lib/go-agent/pipelines/Build-4.5/buildscripts/artifacts/src --yes site-install sbsetup'...
Starting Drupal installation. This takes a few seconds ... [ok]
Installation complete. User name: admin User password: admin [ok]
Mcrypt functions found, setting as default encryption method. [status]
The Springboard module was successfully enabled. Please configure [status]
Springboard now.
The Springboard Admin menu has been created. If you need to rebuild [status]
the menu for any reason, visit the Springboard Configuration page.
The Springboard Admin Menu has been rebuilt. [status]
User role Administrator has been created. [status]
@dbarbar
dbarbar / JunkCept.php
Created October 15, 2014 20:30
./vendor/bin/codecept run acceptance JunkCept.php -d
<?php
$I = new \AcceptanceTester\SpringboardSteps($scenario);
$I->amOnPage('/');
$I->executeInSelenium(function (\Webdriver $webdriver) {
$executor = $webdriver->getCommandExecutor();
$session = $executor->execute('getSession', array());
if ($session['browserName'] == 'phantomjs') {
<?php
$query = 'SELECT stuff FROM {table} WHERE name = :name and nid IN (:nids);';
$condition = array(
"1 ;INSERT INTO {test} SET name = 'test12345678'; -- " => '',
'1' => '',
);
$args = array(
@dbarbar
dbarbar / extend.php
Created October 17, 2014 16:47
Extend Litle sustainers via drush scr extend.php
<?php
$extender = new CommerceLitleSustainerExtender();
$extender->run();
class CommerceLitleSustainerExtender {
protected $tableName;
protected $gatewayName;
/**
<?php
cache_clear_all();
ctools_include('export');
$displays = array('default', 'block', 'page');
$views = array('sbv_notes', 'sbv_administrators');
$anon = user_load(0);
$admin = user_load(1);
foreach ($views as $view_name) {
$view = ctools_export_crud_load('views_view', $view_name);
@dbarbar
dbarbar / update_springboard.sh
Created December 10, 2014 15:32
update springboard
#!/bin/bash
sudo mv docroot/sites/default .
mv docroot/profiles/sbsetup .
mv docroot/sites/all/modules/springboard .
mv docroot/sites/all/themes/springboard_themes .
sudo rm -rf docroot
mkdir docroot
mv *.tar.gz docroot/