Skip to content

Instantly share code, notes, and snippets.

Amitai Burstein amitaibu

Block or report user

Report or block amitaibu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:3608528
#!/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
View gist:3986897
@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"
View gist:3987344
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
View gist:3989148
/**
* 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();
View gist:4010869
db_query("UPDATE {field_data_message_text} SET delta = delta + 1 WHERE bundle = 'message_type_email';");
View gist:4011300
$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;
View gist:4012289
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 Nov 8, 2012
Bash wrapper for installing OS make file
View gist:4038025
#!/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
View gist:4077939
# 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
View gist:4109877
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);
);
You can’t perform that action at this time.