Skip to content

Instantly share code, notes, and snippets.

View bricel's full-sized avatar

Brice Lenfant bricel

View GitHub Profile
# This file describes an application. You can have multiple applications
# in the same project.
# The name of this app. Must be unique within a project.
name: drupal
# The runtime the application uses.
type: "php:7.0"
# Configuration of the build of the application.
➜ danel git:(master) ✗ git push
Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 343 bytes | 0 bytes/s, done.
Total 4 (delta 3), reused 0 (delta 0)
Validating submodules.
Validating configuration files.
Processing activity: **brice@gizra.com** pushed to **Live**
➜ danel git:(master) ✗ git push
Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 343 bytes | 0 bytes/s, done.
Total 4 (delta 3), reused 0 (delta 0)
Validating submodules.
Validating configuration files.
Processing activity: **brice@gizra.com** pushed to **Live**
function [theme name]_preprocess_page(&$variables) {
$menu = menu_get_item();
if (in_array($menu['path], 'some url[]') {
$variables['template_files'][] = "page-app"
}
}
@bricel
bricel / domain_override.php
Last active November 2, 2016 07:53
Domain override programatically drupal 6
<?php
// Add this is idealist_domain.module
// Implements hook_domain_bootstrap_lookup().
function idealist_domain_domain_bootstrap_lookup($domain) {
// Match en.example.org to default domain (id:0)
if ($domain['subdomain'] == 'etna') {
$domain['domain_id'] = 2;
$domain['site_name'] = 'ETNA 2020';
}
return $domain;
@bricel
bricel / tz_check.php
Created October 26, 2016 13:58
בדיקת תקינות ת"ז
<?php
// DEFINE RETURN VALUES
define(R_ELEGAL_INPUT, -1);
define(R_NOT_VALID, -2);
define(R_VALID, 1);
function ValidateID($str)
{
//Convert to string, in case numeric input
#!/usr/bin/env bash
################################################################################
#
# This script will sync Danel profile with the platform profile.
#
#
################################################################################
<?php
/**
* @file
* Drupal needs this blank file.
*/
/**
* Implement hook_menu()
*
* User to test the function.
// Composer's auto-loading functionality
// https://github.com/tijsverkoyen/CssToInlineStyles
require libraries_get_path('css-to-inline') . "/vendor/autoload.php";
$html = "<span> Some html template</span>";
// Set inline CSS.
$css_file_path = drupal_get_path('theme', 'bootstrap_subtheme') . '/bootstrap/css/email.css';
$css_content = file_get_contents($css1);
*/
protected function prepareImages($value) {
$images = parent::fileProcess($value);
$images_clean = array();
dpm($value);
foreach ($images as $image) {
$image['self'] = image_style_url('business_image', $value['uri']);