Skip to content

Instantly share code, notes, and snippets.

View mlutfy's full-sized avatar

Mathieu Lu mlutfy

View GitHub Profile
@MegaphoneJon
MegaphoneJon / smartgroupprofiling.php
Created September 3, 2019 15:19
CiviCRM Smart group profiling
#!/usr/bin/php
<?php
// Use this code to see how long it takes to generate all of your smart groups to find slow ones.
eval(`cv php:boot`);
//Force a refresh of the cache
$sql = 'UPDATE civicrm_group SET cache_date = NULL, refresh_date = NULL';
CRM_Core_DAO::executeQuery($sql);
// Get a list of smart group IDs.
$smartGroups = civicrm_api3('Group', 'get', [
'return' => ["id", "title"],
pcp_views_handlers.info:
name = PCP Views Field Handlers -- Additional
description = Adds some CiviCRM PCP Views handlers
core = 7.x
package = Custom
version = "7.x-1.0"
dependencies[] = civicrm
dependencies[] = views
@bdha
bdha / vbox_to_kvm.txt
Created March 1, 2012 04:04
Migrating from VirtualBox to KVM on ZFS
# It's important to convert the vbox image (VMDK or VDI or whatever) using
# the same version of VirtualBox that created it. You can try converting the image
# with qemu-img or kvm-img, but weird version mismatches will possibly make it not
# work.
# On your VirtualBox machine:
cd $VBOX_ROOT/$MACHINE_ROOT/
VBoxManage clonehd machine.vmdk machine.img --format RAW
scp machine.img root@kvm-host:/somewhere