Skip to content

Instantly share code, notes, and snippets.

View amitaibu's full-sized avatar

Amitai Burstein amitaibu

View GitHub Profile
#!/bin/bash
BUILD=/Applications/MAMP/htdocs/openscholar
NEWDIR=/Applications/MAMP/htdocs/os
cd $BUILD
bash scripts/build.sh -y $NEWDIR
cd $NEWDIR
drush sql-drop -y
@api
Scenario: Visting homepage should redircet me to the active season page.
Given I am logged in as a user with the "authenticated user" role
When I go to page "/"
Then I should be redirect to a "season" page titled "Autumn-Winter 2013 Women"
drush si -y openscholar --account-pass=admin --db-url=mysql://root:@127.0.0.1/drupal --uri=http://127.0.0.1 openscholar_flavor_form.os_profile_flavor=development openscholar_install_type.os_profile_type=vsite
drush vset purl_base_domain http://127.0.0.1
/**
* Implements hook_init().
*/
function foo_init() {
$field = field_info_field('bar');
$instance = field_info_instance('node', 'bar', 'baz');
// This will call SelectionBase
$handler = entity_reference_get_selection_handler($field, $instance);
$ids = $handler->getReferencableEntities();
db_query("UPDATE {field_data_message_text} SET delta = delta + 1 WHERE bundle = 'message_type_email';");
$gids = og_get_entity_groups('user', $account);
if (empty($gids['node'])) {
return;
}
// Query flag to see if subscribing to any given groups.
// $gids['node'];
if (!$result) {
return;
Drupal.behaviors.hvNinesixty = {
attach: function (context) {
$(document)
.bind('drupalOverlayOpen', function() {
$('iframe:not(iframe.overlay-element)').hide();
})
.bind('drupalOverlayClose', function() {
$('iframe:not(iframe.overlay-element)').show();
})
@amitaibu
amitaibu / gist:4038025
Created November 8, 2012 10:36
Bash wrapper for installing OS make file
#!/bin/bash
SOURCE=/Applications/MAMP/htdocs/os-make
TARGET=/Applications/MAMP/htdocs/os-build
cd $SOURCE
bash scripts/build.sh -y $TARGET
cd $TARGET
drush sql-drop -y
# Check if settings.php exists, which means it is an existing installation.
if [ -f $BUILD_ROOT/www/sites/default/settings.php ]; then
cp -rp $BUILD_ROOT/www/sites/default sites-backup
fi
foreach ($item_variations as $item_variation) {
$nid = $item_variation->nid;
$form[$nid] = array(
'#markup' => check_plain($item_variation->title);
);
foreach ($types as $type) {
$form[$nid][$type] = array(
'#markup' => check_plain($label);
);