Skip to content

Instantly share code, notes, and snippets.

View mllavez's full-sized avatar
:octocat:
Cat Pops

Marcos Alexander Chávez mllavez

:octocat:
Cat Pops
View GitHub Profile
(async function (workflow, context) {
const { get } = context.libs;
const PRODUCT_LINE_FIELDS = {
lineProductBucket: "product_field12", // Product Bucket
lineLineTotal: "product_field1", // Line Total
lineOwner: "product_field1027", // Owner
parentId: "parent_entity_reference_id", // Parent ID
parentMonth: "product_field1022", // Month
parentYear: "product_field1023", // Year
/****************************************************************
const createNewCommunity = async (communityName, indigenousAffiliation) => {
try {
const request_variables = {
entity: 'community',
field_values: {
community_field0: communityName,
community_field2: indigenousAffiliation,
},
"forceAsyncPostCreateProcessing": true
@mllavez
mllavez / freeAgentCRMFix.css
Last active June 17, 2022 19:52
FreeAgentCRM CSS
/*
Custom Styling to improve FreeAgentCRM
👉 Chrome Extension
https://chrome.google.com/webstore/detail/user-css/okpjlejfhacmgjkmknjhadmkdbcldfcb
*/
//Fix field entry containers & sub-containers
.form-container.entityForModalContainer, .form-container .form-gen-div, {
@mllavez
mllavez / divi-sass-skeleton.scss
Last active November 26, 2019 00:04
Divi Sass Skeleton
html{
body{
#page-contianer{
#et-boc{
header{
.et_builder_inner_content{
}//.et_builder_inner_content
}//header
#et-main-area{
#main-content{
@mllavez
mllavez / jurchiks101phpgenerateCallTrace
Created April 25, 2017 18:29
PHP Error Handling - @jurchiks101's generateCallTrace()
<?php
/**
* jurchiks101_at_gmail_dot_com
* Can be found at http://php.net/manual/en/function.debug-backtrace.php#112238
*/
function generateCallTrace()
{
$e = new Exception();
$trace = explode("\n", $e->getTraceAsString());
// reverse array to make steps line up chronologically
@mllavez
mllavez / OpenWithSublimeText2.bat
Created April 14, 2017 15:54 — forked from mrchief/LICENSE.md
Add "Open with Sublime Text 2" to Windows Explorer Context Menu (including folders)
@echo off
SET st2Path=C:\Program Files\Sublime Text 2\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2" /t REG_SZ /v "" /d "Open with Sublime Text 2" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2" /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2\command" /t REG_SZ /v "" /d "%st2Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 2" /t REG_SZ /v "" /d "Open with Sublime Text 2" /f
@mllavez
mllavez / load-html-as-utf-8-php-hack.php
Created April 6, 2017 20:58
load HTML as UTF-8 using simple hack:
<?php
/**
* @mdmitry at gmail dot com
*
*/
$doc = new DOMDocument();
$doc->loadHTML('<?xml encoding="UTF-8">' . $html);
// dirty fix
@mllavez
mllavez / shuffle_assoc
Created April 6, 2017 18:20 — forked from Quinten/shuffle_assoc
shuffle an array while preserving keys
<?php
function shuffle_assoc($list) {
if (!is_array($list)) return $list;
$keys = array_keys($list);
shuffle($keys);
$random = array();
foreach ($keys as $key)
$random[$key] = $list[$key];
return $random;
@mllavez
mllavez / print_r2.php
Created April 5, 2017 21:58 — forked from Shelob9/print_r2.php
Make print_r() more readable. Found on http://us2.php.net/print_r
<?php
function print_r2($val){
echo '<pre>';
print_r($val);
echo '</pre>';
}
?>