Skip to content

Instantly share code, notes, and snippets.

@MegaphoneJon
MegaphoneJon / gist:6e49eb4f0cfbae362202166cf700573c
Last active August 14, 2019 04:03
RimWorld Hardcore SK bugs to evaluate
* -UI zoom=in places work jobs in the wrong place on the UI (RimThemesLite? Work tab vertical text option?)- [This is a known issue](https://github.com/fluffy-mods/WorkTab/issues/77)
* Methadone doesn't work?
* Animals aren't affected by cold?
@MegaphoneJon
MegaphoneJon / grantexpensepatch.diff
Last active September 8, 2019 01:51
Hack to allow selecting Grant Expense Accounts since PR#14058 was rejected
--- a/CRM/Financial/BAO/FinancialAccount.php
+++ b/CRM/Financial/BAO/FinancialAccount.php
@@ -292,6 +292,7 @@
'Discounts Account is' => 'Revenue',
'Sales Tax Account is' => 'Liability',
'Deferred Revenue Account is' => 'Liability',
+ 'Grant Expense Account is' => 'Expenses',
];
if (!$flip) {
foreach ($Links as $accountRelation => $accountType) {
@MegaphoneJon
MegaphoneJon / Kettle experiment
Created July 2, 2018 00:03
This is some code I was writing to test changing field names in Kettle with the UJDC step. Turns out you really need the ETL Metadata Injection step or nothing to change field names.
//Fields.In is a rowMetaInterface.
// We want to call the setName method of the valueMetaInterface, which we can grab from rowMetaInterface.
private FieldHelper inputField = null;
private ValueMetaInterface vMeta = null;
private int index;
public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException
{
// Get a row from the stream.
Object[] r = getRow();
--- mysql.orig 2016-02-20 14:31:25.601574577 -0500
+++ mysql 2016-02-20 14:52:32.685574577 -0500
@@ -238,14 +238,14 @@
then
if [ $usevserver = yes ]
then
- debug 'set -o pipefail ; echo show databases | $VSERVER $vsname exec su $user -c \"$MYSQL $defaultsfile\" | grep -v Database'
- databases=`set -o pipefail ; echo 'show databases' | $VSERVER $vsname exec su $user -c "$MYSQL $defaultsfile" | grep -v Database`
+ debug 'set -o pipefail ; echo show databases | $VSERVER $vsname exec su $user -c \"$MYSQL $defaultsfile\" | grep -v Database | grep -v '^\(information\|performance\)_schema$''
+ databases=`set -o pipefail ; echo 'show databases' | $VSERVER $vsname exec su $user -c "$MYSQL $defaultsfile" | grep -v Database | grep -v '^\(information\|performance\)_schema$'`
@MegaphoneJon
MegaphoneJon / backupninja_icinga2.sh
Last active February 16, 2017 18:18
Icinga2 integration into backupninja
function generate_post_data() {
cat <<EOF
{
"exit_status": $EXIT_STATUS,
"plugin_output": "$PLUGIN_OUTPUT"
}
EOF
}
function generate_post_reschedule() {
@MegaphoneJon
MegaphoneJon / sharedaddresssync.php
Created October 2, 2014 15:28
CiviCRM shared address sync module
<?php
require_once 'sharedaddressstatussync.civix.php';
function sharedaddressstatussync_civicrm_custom( $op, $groupID, $entityID, &$params ) {
//if a master address' location type is changed to "Bad Address", set the shared address' location type to same.
if ($op == 'edit') {
//Custom Group ID for Address Status is 5.
if($groupID == 5) {
$status = $params[0]['value'];