Skip to content

Instantly share code, notes, and snippets.

View mlutfy's full-sized avatar

Mathieu Lu mlutfy

View GitHub Profile
diff --git a/CMakeLists.txt b/CMakeLists.txt
index eb54ca7..8408d02 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -54,6 +54,9 @@ set(USE_LOCAL OFF CACHE BOOL "Use the locally built packages when building image
set(JOBS "2" CACHE STRING "Number of parallel compile jobs")
set(DL_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE FILEPATH "Custom download directory")
+# Packages for Reseau Libre
+set(RESEAULIBRE_PACKAGES "babeld;tinc" CACHE INTERNAL "Reseau Libre default packages")
@mlutfy
mlutfy / civicrm-4.7-d8.make
Created March 6, 2016 20:31
civicrm-4.7-d8.make
api = 2
core = 8.x
projects[] = "drupal"
libraries[civicrm][type] = "library"
libraries[civicrm][directory_name] = "civicrm"
libraries[civicrm][download][type] = "get"
libraries[civicrm][download][url] = "http://downloads.sourceforge.net/project/civicrm/civicrm-stable/4.7.3/civicrm-4.7.3-drupal.tar.gz"
@mlutfy
mlutfy / civicrm-d8-version.patch
Last active March 6, 2016 22:24
civicrm-d8-version.patch
--- civicrm-version.php 2016-03-06 17:02:28.692925000 -0500
+++ civicrm-version.php 2016-03-06 17:17:46.104925000 -0500
@@ -1,7 +1,7 @@
<?php
function civicrmVersion( ) {
return array( 'version' => '4.7.3',
- 'cms' => 'Drupal',
+ 'cms' => 'Drupal8',
'revision' => '7ad5c1d6a1' );
}
--- civicrm.install 2016-03-06 17:25:00.000000000 -0500
+++ civicrm.install 2016-03-06 15:53:55.304925000 -0500
@@ -117,7 +117,7 @@
function _civicrm_find_civicrm() {
// Only acceptable location for civicrm is in /libraries/civicrm
- $path = \Drupal::root() . '/libraries/civicrm';
+ $path = \Drupal::root() . '/modules/civicrm';
if (file_exists($path . '/CRM/Core/ClassLoader.php')) {
return realpath($path);
@mlutfy
mlutfy / civicrm-verify-custom-fields.php
Created March 10, 2016 00:38
civicrm-verify-custom-fields.php
<?php
civicrm_initialize();
$dao = CRM_Core_DAO::executeQuery('SELECT * FROM civicrm_custom_field');
while ($dao->fetch()) {
$table_name = CRM_Core_DAO::singleValueQuery('SELECT table_name FROM civicrm_custom_group WHERE id = %1', array(1 => array($dao->custom_group_id, 'Integer')));
$group_title = CRM_Core_DAO::singleValueQuery('SELECT title FROM civicrm_custom_group WHERE id = %1', array(1 => array($dao->custom_group_id, 'Integer')));
@mlutfy
mlutfy / gist:17622c2764472fbf71d0
Last active March 20, 2016 19:14
ldapjs bind and synchronize
// w.i.p.
// Based on : https://github.com/TechToThePeople/ldapcivi
var ldap = require('ldapjs');
var _ = require('underscore');
var settings = {};
if (process.argv.length >= 3) {
console.log ("Using config file config/" + process.argv[2] + '.js');
@mlutfy
mlutfy / gist:9708e96f265c2e751acd843cad2b5af3
Created April 8, 2016 19:14
Shrink varchar select fields
<?php
// Set this to the CiviCRM DB name
$db_name = 'XXXX';
civicrm_initialize();
$sql = "SELECT TABLE_NAME, COLUMN_NAME, CHARACTER_MAXIMUM_LENGTH
FROM INFORMATION_SCHEMA.COLUMNS
WHERE DATA_TYPE IN ('varchar')
@mlutfy
mlutfy / timetrack.js
Last active December 6, 2016 14:16
Timetrack CiviCRM Mattermost
/*
Description:
SymbioTIC Time Tracker
Configuration:
HUBOT_TIMETRACK_URL - CiviCRM URL (ex: https://crm.symbiotic.coop).
See also configuration file:
https://gist.github.com/mlutfy/b452f628bd79103a98283c48a2a39770
@mlutfy
mlutfy / civicrm_country.tpl
Created May 9, 2016 14:18
Reverting CRM-16876
/*!40101 SET NAMES utf8 */;
/*******************************************************
*
* civicrm_county
*
*******************************************************/
SET FOREIGN_KEY_CHECKS=0;
REPLACE INTO civicrm_country (id, name,iso_code,region_id,is_province_abbreviated) VALUES("1001", "Afghanistan", "AF", "4", "0");
var settings = {}
settings.civicrm = {},
settings.civicrm.server = "https://crm.example.coop",
settings.civicrm.path = "/sites/all/modules/civicrm/extern/rest.php",
settings.civicrm.api_key = "[api key of a user]",
settings.civicrm.key = "[civicrm site key]",
// Map usernames to Drupal uid
settings.mapping = {