Skip to content

Instantly share code, notes, and snippets.

View bricel's full-sized avatar

Brice Lenfant bricel

View GitHub Profile
#!/bin/bash
echo -n "GitHub User: "
USER="<username>"
echo -n "GitHub Password: "
PASS="<passowrd>"
echo ""
echo -n "GitHub Repo (e.g. foo/bar): "
@bricel
bricel / resave.php
Created November 22, 2015 18:37
Resave all nodes
<?php
/**
* Created by JetBrains PhpStorm.
* User: Brice
* Date: 6/23/13
* Time: 22:05 PM
* To change this template use File | Settings | File Templates.
*/
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'node');
@bricel
bricel / gist:5c5a804bf438241c629d
Created September 24, 2015 07:41
Import from csv snipet
<?php
/**
* Created by PhpStorm.
* Migrate taxonomy terms with heiarchy for open calls
* User: brice
* Date: 9/21/15
* Time: 3:04 PM
*/
// drush @sh scr sites/all/modules/idealist/drush/open-calls-import.php --src='csv/calls.csv'
@bricel
bricel / gist:8736f404166869bc2db4
Created July 30, 2015 06:39
MAC install shoov
npm install -g yo mocha generator-shoov
brew install graphicsmagick
@bricel
bricel / update.sh
Created July 13, 2015 10:57
Update pantheon foder
rsync -azvr --delete-after ../productivity/productivity profiles/
rsync -azvr --delete-after ../productivity/www/app/ app/
<?php
class MimeMailSystem__SmtpMailSystem implements MailSystemInterface {
protected $formatClass;
protected $mailClass;
public function __construct() {
if (drupal_autoload_class('MimeMailSystem')) {
$this->formatClass = new MimeMailSystem;
}
else {
$this->formatClass = new DefaultMailSystem;
@bricel
bricel / gist:d4b1429aa5270ffc0b47
Created May 3, 2015 13:41
reset 403 image style
drush @cri.dev vset image_allow_insecure_derivatives 1 --strict=0
drush @cri.dev vset image_allow_insecure_derivatives 0 --strict=0
$query = db_select('field_data_name_field', 'nf');
$query->join('taxonomy_term_hierarchy', 'tth', 'tth.tid = nf.tid');
$query->addField('nf', 'name_field_value', 'name');
$query->addField('nf', 'entity_id', 'tid');
$query
->condition('entity_type', 'taxonomy_term')
->condition('bundle', $bundle)
->condition('name', db_like($prefix) . '%', 'LIKE')
->range(0, 10)
// Find the designer node.
$conditions = array(
'title_field' => array('type' => 'field', 'value' => $row->designer_heb),
);
if ($designer_nid = $this->createNode('designer', $conditions, $values)) {
$wrapper->field_designer->set($designer_nid);
}
$query
->entityCondition('entity_type', 'node')
->range(0,1)
->propertyOrderBy('updated', DESC);
$result = $query->execute();
if (empty($result['node'])) {
return time("10.10.2014");
}