Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael Z Daryabeygi ginkgomzd

View GitHub Profile
@ginkgomzd
ginkgomzd / Makefile
Last active Mar 13, 2020
Makefile to on-board WP Engine sites for administration: set admin email and upgrade plugins, etc...
View Makefile
# # #
# Looks for ${PROJ_ROOT}conf/ssh_config.
# Export PROJ_ROOT or SSH_CONFIG
#
# Minimal orchestration through filtering of HOST_LIST
# by a prefix/suffix in ssh Host aliases specified in ENV.
# Defaults to 'stage'
#
# Targets with 'all-' prefix execute commands against all
@ginkgomzd
ginkgomzd / alias_gitsubs.sh
Created Nov 12, 2019
bash function (such as you might put in .bash_aliases) to perform git commands on nested repos
View alias_gitsubs.sh
#!/bin/bash
gitsubs() {
gitsubs_max_depth=12
echo searching for git repos
echo directory max-depth = $gitsubs_max_depth
echo executing git $@
( # use a subshell and change the field-separator
# to allow for spaces in filenames
@ginkgomzd
ginkgomzd / Makefile
Last active Nov 13, 2019
create website snapshot (gnu make)
View Makefile
PROJ_ROOT = /var/www/#
WEB_ROOT = ${PROJ_ROOT}html/#
ARCH_DIR = ${PROJ_ROOT}util/#
TAR_EXCLUDES = templates_c ConfigAndLog private/backup_migrate naloxone-training files/civicrm/custom default/files/civicrm/upload
all snapshot: clean html.tgz members.sql.gz
define tar-exclude-list
$(foreach excl,$1,--exclude=${excl} )
endef
@ginkgomzd
ginkgomzd / list-custom-msg-tpl.sql
Created Sep 4, 2019
List Modified System Workflow Msg Templates
View list-custom-msg-tpl.sql
SELECT
og.name,
ov.id, ov.name, ov.label
FROM
civicrm_msg_template tpl
INNER JOIN
civicrm_msg_template r -- reserved tpls
ON r.is_reserved = 1 AND r.is_default = 0
AND tpl.is_default = 1 AND tpl.is_reserved = 0
AND r.workflow_id = tpl.workflow_id
@ginkgomzd
ginkgomzd / gist:76f5d986377a685f9d6d54161c9d4f8f
Created Jul 8, 2019
sample bootsrap civi in drupal module
View gist:76f5d986377a685f9d6d54161c9d4f8f
<?php
// Returns rendered markup for the hunger organization profile page
function nyccah_hunger_organization_render($hunger_organization_id) {
if(!is_numeric($hunger_organization_id)) {
drupal_access_denied();
return;
}
civicrm_initialize();
View restore_employer.sql
use leaderce_sdbx_civicrm;
DROP TABLE IF EXISTS log_contacts;
CREATE TABLE IF NOT EXISTS log_contacts AS (
SELECT log.* FROM
log_civicrm_contact log
INNER JOIN
( SELECT id, MAX(log_date) log_date FROM log_civicrm_contact WHERE employer_id IS NOT NULL GROUP BY id) latest
@ginkgomzd
ginkgomzd / admin.yaml
Created Feb 8, 2019
user/localhost/config/plugins/
View admin.yaml
widgets:
dashboard-maintenance: true
dashboard-statistics: false
dashboard-notifications: false
dashboard-feed: false
dashboard-pages: true
notifications:
feed: false
dashboard: false
plugins: false
@ginkgomzd
ginkgomzd / git-sync.yaml
Created Feb 8, 2019
user/localhost/config/plugins/git-sync.yaml
View git-sync.yaml
enabled: false
@ginkgomzd
ginkgomzd / system.yaml
Created Feb 8, 2019
user/localhost/config/system.yaml
View system.yaml
debugger:
enabled: true
shutdown:
close_connection: true
twig: true
@ginkgomzd
ginkgomzd / mock-post-back
Created Feb 6, 2019
CiviCRM Mock Authorize.net IPN Postback
View mock-post-back
#!/bin/bash
# for development, you can go bare-metal with this URL:
# no payment processor ID necessary:
# THE_URL=http://awesome.org/sites/all/modules/civicrm/extern/authorizeIPN.php
# Confirm the URL to use in the Authorize.net Silent-Post URL:
# last URL segment is the payment processor ID
THE_URL="https://awesome.org/civicrm/payment/ipn/1"
You can’t perform that action at this time.