Skip to content

Instantly share code, notes, and snippets.

View dbarbar's full-sized avatar

David Barbarisi dbarbar

View GitHub Profile
@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.'
@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');
#!/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 / 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
@dbarbar
dbarbar / gist:9399443
Last active August 29, 2015 13:57
sf.php
<?php
$batch = array(
'sobjects' => array(
'aobject 0',
'sobject 1',
'sobject 2',
'sobject 3',
'sobject 4',
'sobject 5',
@dbarbar
dbarbar / setup_codebase.sh
Created November 25, 2013 19:48
Shell script to setup springboard 4 for development.
#!/bin/bash
rm -rf src
drush make https://raw.github.com/JacksonRiver/Springboard-Build/7.x-4.x/springboard.build src
cp -f settings.php src/sites/default
cd src/sites/all/modules
rm -rf springboard
git clone [email protected]:JacksonRiver/springboard_modules.git springboard
<?php
$path = CWD;
$site_dir = NULL;
$dpl_dir = NULL;
while ($path != '/') {
if (file_exists($path . '/settings.php')) {
$site_dir = $path;
<?php
dpm($keyed_components['donation']);
webform_component_update($keyed_components['donation']);
/*
dpm result =
... (Array, 11 elements)
nid (Integer) 48
@dbarbar
dbarbar / .zshrc
Created October 1, 2013 19:57
aliases for my springboard work
alias -r sb3up="cd ~/Development/work/sb3 && vagrant up"
alias -r sb3down="cd ~/Development/work/sb3 && vagrant suspend"
alias -r sb4up="cd ~/Development/work/sb4 && vagrant up"
alias -r sb4down="cd ~/Development/work/sb4 && vagrant suspend"
alias -r sb3work="sb4down && sb3up && pstorm . && open http://sb3.dev && cd src/profiles/springboard/modules/springboard_modules"
alias -r sb4work="sb3down && sb4up && pstorm . && open http://sb4.dev && cd src/sites/all/modules/springboard"
alias -r sbdown="sb3down && sb4down"
<?php
$results = db_query("SELECT order_id, next_charge FROM {fundraiser_recurring} WHERE FROM_UNIXTIME(next_charge) > NOW() and gateway_resp IS NULL");
$count = 0;
while ($row = db_fetch_object($results)) {
$replacements = array('!date' => date('n/j/Y', $row->next_charge));
uc_order_comment_save($row->order_id, 0, t('This order is scheduled to process on !date.', $replacements), 'admin');
drush_print('Added comment to order ' . $row->order_id . ' with next_charge ' . $row->next_charge);
$count++;
}