Skip to content

Instantly share code, notes, and snippets.

@herbdool
herbdool / gist:e2253c284422f205397f
Created June 16, 2014 14:52
Crappy time entry list
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta name="Name" content="App Example: Time Logs"/>
<title>Time logs</title>
<script type="text/javascript" src="/apps/1.26/sdk.js"></script>
<script type="text/javascript">
function timeLogs() {
@herbdool
herbdool / pantheon-settings-civicrm-4-5.patch
Last active August 29, 2015 14:16
pantheon-settings-civicrm-4-5.patch
--- /templates/CRM/common/civicrm.settings.php.template
+++ /templates/CRM/common/civicrm.settings.php.template
@@ -54,6 +54,60 @@
define( 'CIVICRM_UF' , '%%cms%%' );
}
+ /**
+ * Pantheon Systems:
+ *
+ * Repopulate needed variables based on the Pantheon environment if applicable.
@herbdool
herbdool / redis-caching-civicrm-4-5.patch
Created April 17, 2015 01:33
redis-caching-civicrm-4-5.patch
diff --git a/CRM/Utils/Cache.php b/civicrm/CRM/Utils/Cache.php
index e2cdd2d..b106c3c 100644
--- a/CRM/Utils/Cache.php
+++ b/CRM/Utils/Cache.php
@@ -108,6 +108,7 @@ class CRM_Utils_Cache {
$defaults = array();
break;
+ case 'Redis':
case 'Memcache':
@herbdool
herbdool / pantheon-redis-settings.patch
Created April 17, 2015 01:43
Pantheon redis settings
diff --git a/templates/CRM/common/civicrm.settings.php.template b/templates/CRM/common/civicrm.settings.php.template
index 41518ca..21dc8fe 100644
--- a/templates/CRM/common/civicrm.settings.php.template
+++ b/templates/CRM/common/civicrm.settings.php.template
@@ -281,6 +281,22 @@ if (!defined('CIVICRM_DOMAIN_ID')) {
*/
/**
+* Redis Caching
+* Using Redis Caching via an extention instead of database -- uncomment below to use.
diff --git a/CRM/Extension/Mapper.php b/CRM/Extension/Mapper.php
index f765afb..ac27547 100755
--- a/CRM/Extension/Mapper.php
+++ b/CRM/Extension/Mapper.php
@@ -288,6 +288,10 @@ class CRM_Extension_Mapper {
$moduleExtensions = $this->cache->get($this->cacheKey . '/moduleFiles');
}
+ if ($fresh == 'NOCACHE') {
+ $moduleExtensions = NULL;
diff --git a/CRM/Utils/Cache.php b/CRM/Utils/Cache.php
index 94b2cfb..d03955d 100644
--- a/CRM/Utils/Cache.php
+++ b/CRM/Utils/Cache.php
@@ -105,6 +105,7 @@ class CRM_Utils_Cache {
$defaults = array();
break;
+ case 'Redis':
case 'Memcache':
@herbdool
herbdool / backend-payments.patch
Created May 29, 2018 00:16
Stripe backend payments fix
diff --git a/CRM/Core/Form/Stripe.php b/CRM/Core/Form/Stripe.php
index 828e2ea..4b4963e 100644
--- a/CRM/Core/Form/Stripe.php
+++ b/CRM/Core/Form/Stripe.php
@@ -8,9 +8,35 @@ class CRM_Core_Form_Stripe extends CRM_Core_Form {
/**
* Function to access protected payProcessors array in event registraion forms
+ * to see if any of them are stripe processors.
*/
verbose: /usr/share/lando/bin/docker-compose,--project-name,gottabd,--file,/home/herb/.lando/compose/gottabd/globals-0.yml,--file,/home/herb/.lando/compose/gottabd/appserver-0.yml,--file,/home/herb/.lando/compose/gottabd/appserver-1.yml,--file,/home/herb/.lando/compose/gottabd/appserver-2.yml,--file,/home/herb/.lando/compose/gottabd/appserver-3.yml,--file,/home/herb/.lando/compose/gottabd/database-0.yml,--file,/home/herb/.lando/compose/gottabd/database-1.yml,--file,/home/herb/.lando/compose/gottabd/database-2.yml,--file,/home/herb/.lando/compose/gottabd/database-3.yml,--file,/home/herb/.lando/compose/gottabd/database-4.yml,--file,/home/herb/.lando/compose/gottabd/database-5.yml,--file,/home/herb/.lando/compose/gottabd/proxy-0.yml,up,--detach,--no-recreate,--remove-orphans,appserver finished with code 0
verbose: Running ["/usr/share/lando/bin/docker-compose","--project-name","gottabd","--file","/home/herb/.lando/compose/gottabd/globals-0.yml","--file","/home/herb/.lando/compose/gottabd/appserver-0.yml","--file
@herbdool
herbdool / gist:54ca80f8089c261e072896fb6a1be2bf
Created January 24, 2020 14:55 — forked from bryhal/gist:4129042
MYSQL: Generate Calendar Table
DROP TABLE IF EXISTS time_dimension;
CREATE TABLE time_dimension (
id INTEGER PRIMARY KEY, -- year*10000+month*100+day
db_date DATE NOT NULL,
year INTEGER NOT NULL,
month INTEGER NOT NULL, -- 1 to 12
day INTEGER NOT NULL, -- 1 to 31
quarter INTEGER NOT NULL, -- 1 to 4
week INTEGER NOT NULL, -- 1 to 52/53
day_name VARCHAR(9) NOT NULL, -- 'Monday', 'Tuesday'...
@herbdool
herbdool / civicrm.settings.local.php
Created November 18, 2021 18:24
CiviCRM settings file for Drupal 9 on Pantheon
<?php
/**
* CiviCRM Configuration File.
*/
/**
* Installing CiviCRM with Drupal 9 on Pantheon.
*
* 1. Create a new site on Pantheon using Drupal 9 (sftp mode).