Skip to content

Instantly share code, notes, and snippets.

View amitaibu's full-sized avatar

Amitai Burstein amitaibu

View GitHub Profile
if (drupal_is_cli()) {
ini_set('max_input_time', 120);
}
@amitaibu
amitaibu / gist:4189151
Created December 2, 2012 14:50
Migrate 2.5
/**
* Implements hook_migrate_api().
*/
function garmentbox_migrate_migrate_api() {
$api = array(
'api' => 2,
'migrations' => array(
'GarmentboxUsers' => array('class_name' => 'GarmentboxUsers'),
// Terms.
'garmentboxSeasonStatusTerms' => array('class_name' => 'garmentboxSeasonStatusTerms'),
@amitaibu
amitaibu / gist:4193683
Created December 3, 2012 08:39
GarmentBox build
#!/bin/bash
cd /Applications/MAMP/htdocs/opengizra
chmod -R 777 www/
bash scripts/build
cd www
drush sql-drop -y
drush si -y garmentbox --account-pass=admin --db-url=mysql://root:root@localhost/opengizra_build --uri=http://local:8888/opengizra/www
================================================================================
Error executing action `install` on resource 'package[php5-xhprof]'
================================================================================
Chef::Exceptions::Exec
----------------------
$values = array(
'uid' => 1,
'type' => 'school',
'title' => time(),
);
$group = entity_create('node', $values);
node_save($group);
$values = array(
'uid' => 1,
$gids = og_get_entity_groups($entity_type, $id);
4 if (count($gids) == 1) {
5 $gids = reset($gids);
6 if (count($gids) > 1) {
7 continue;
8 }
9 }
if ($field['cardinality'] > 1) {
foreach ($wrapper->{$field_name}->value() as $delta => $term) {
if ($term->vid != $this->vid) {
$wrapper->{$field_name}->offsetUnset($delta);
}
}
}
/**
* Implements hook_views_pre_render().
*/
function message_views_pre_render(&$view) {
if ($view->base_table != 'message' || empty($view->result[0]->mid)) {
// Not a message view, or no results with message ID.
return;
}
$mids = array();
[2012-12-24T19:51:55+01:00] INFO: Processing git[/usr/share/drush] action sync (drush::head line 20)
[2012-12-24T19:52:50+01:00] INFO: git[/usr/share/drush] cloning repo git://git.drupal.org/project/drush.git to /usr/share/drush
================================================================================
Error executing action `sync` on resource 'git[/usr/share/drush]'
================================================================================
@amitaibu
amitaibu / gist:4441928
Created January 3, 2013 08:51
Build script
#!/bin/bash
cd /Applications/MAMP/htdocs/opengizra
chmod -R 777 www/
bash scripts/build
cd www
drush sql-drop -y
drush si -y garmentbox --account-pass=admin --db-url=mysql://root:root@localhost/opengizra_build --uri=http://local:8888/opengizra/www
drush mi --all --user=1