Skip to content

Instantly share code, notes, and snippets.

Avatar
🛒
Code, Eat, Sleep++;

Jared molotovbliss

🛒
Code, Eat, Sleep++;
View GitHub Profile
View apache-as-proxy.conf
<FilesMatch \.php$>
<If "%{HTTP_COOKIE} =~ /XDEBUG_SESSION/">
SetHandler "proxy:fcgi://10.0.2.2:9172"
</If>
<Else>
SetHandler "proxy:fcgi://10.0.2.2:9072"
</Else>
ProxyFCGISetEnvIf "true" PATH_INFO "%{reqenv:SCRIPT_NAME}"
ProxyFCGISetEnvIf "true" SCRIPT_FILENAME "/var/www/vhosts/magento/pub%{reqenv:SCRIPT_NAME}"
</If>
@molotovbliss
molotovbliss / xeogl-debug-logPick.js
Last active Feb 18, 2021 — forked from xeolabs/xeogl-debug-logPick.js
Drop in Chrome console to log info on each (pickable) Entity you click on -- #xeogl #debugging
View xeogl-debug-logPick.js
(function () {
var scenes = window.xeogl.scenes;
for (var sceneId in scenes) {
if (scenes.hasOwnProperty(sceneId)) {
scenes[sceneId].input.on("mouseclicked", function (coords) {
var hit = this.scene.pick({ // "this" points to the xeogl.Input component
canvasPos: coords,
pickSurface: true
});
console.log("=================== DEBUG PICKED =======================");
@molotovbliss
molotovbliss / xslt-tips.md
Last active Feb 19, 2020
XSLT/XML - CLI tricks with xsltproc and xmllint
View xslt-tips.md

Tricks from the Command Line: xsltproc and xmllint

Often, when writing an XSLT file, you’ll want to test it quickly, without contacting a FileMaker Server or otherwise accessing the rest of the world. On Linux and OS X, you can use the command-line utility, ‘xsltproc’, to run XSLT programs quickly:

xsltproc transform.xsl input.xml

This applies the stylesheet in the file transform.xml to the XML in input.xml, and writes the output to your terminal. You can instead write the output to a file:

xsltproc transform.xsl input.xml > output.xml

@molotovbliss
molotovbliss / README.md
Last active Sep 7, 2021
Speed up warden for faster importing of large sql dumps.
View README.md

Speed up warden for faster importing of large sql dumps.

  1. Add the innodb options to the warden/environments/magento2.base.yml docker-compose YML file.
  2. Restart warden environment warden env down && warden sync stop && warden env up -d && warden sync start
  3. Import the .sql file with warden db import.
  4. Remove options & restart warden enviornment once import completed.

Why these settings

  • innodb_buffer_pool_size : Will cache frequently read data
@molotovbliss
molotovbliss / clixdebug.cmd
Created Nov 12, 2019
Warden command for xdebug from CLI
View clixdebug.cmd
#!/usr/bin/env bash
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!" && exit 1
source "${WARDEN_DIR}/utils/env.sh"
WARDEN_ENV_PATH="$(locateEnvPath)" || exit $?
loadEnvConfig "${WARDEN_ENV_PATH}" || exit $?
pushd "${WARDEN_DIR}" >/dev/null
# docker exec -ti <CONTAINER_ID> php -d xdebug.remote_autostart=on -d xdebug.remote_host=host.docker.internal bin/magento
containerid=$(docker ps -qf "name=debug")
@molotovbliss
molotovbliss / jblalock-resume-2020.md
Last active May 6, 2020
Jared Blalock Resume 2020
View jblalock-resume-2020.md

Jared Blalock

Creative Solutions Architect - Aubrey, Texas

👷 OVERVIEW

The pursuit of technology itself. Uniquely positioned architect with 20+ years experience with a full spectrum of (IT) Information Technologies; encompassing cutting-edge technology with established best practices & paradigms.

🕑 EXPERIENCE

@molotovbliss
molotovbliss / Magento2addCMSblock.php
Last active Jul 17, 2019
Magento 2, add CMS block programmatically
View Magento2addCMSblock.php
<?php
namespace Rbj\CmsBlockCreate\Model;
use Magento\Cms\Model\BlockFactory;
use Magento\Cms\Api\BlockRepositoryInterface;
use Magento\Framework\Api\SearchCriteriaBuilder;
class AddBlock
{
protected $searchCriteriaBuilder;
@molotovbliss
molotovbliss / m1-eav-installer-script.php
Last active Jun 20, 2019
EAV custom entities example Magenot 1 installer script.
View m1-eav-installer-script.php
<?php
// EAV custom entities example Magenot 1 installer script.
/* @var $installer Mage_Eav_Model_Entity_Setup */
$installer = Mage::getModel('eav/entity_setup', 'default_setup');
$installer->startSetup();
// Example createEntityTables() call
$installer->createEntityTables('example_supplier');
@molotovbliss
molotovbliss / treesize.sh
Created Jun 15, 2019
Basic treesize bash script with du & better defaults
View treesize.sh
#/bin/sh
#set -x #echo on
if [ "$1" == "-h" ]; then
echo "usage: treesize [depth (0)] [sizelimit (1MB)]"
echo ""
echo "example: treesize 3 20G"
echo ""
echo "Show all folders larger than 20GBs & only scan 3 directories in deep"
echo "defaults are 0 depth, 1MB limit equiv to treesize 0 1MB"
@molotovbliss
molotovbliss / jnewfiles
Created Apr 27, 2019 — forked from renekreijveld/jnewfiles
Bash script to detect new and changed php and html files last 3 hours. Skips cache directories.
View jnewfiles
#!/bin/sh
# jnewfiles
# Detects new and changed php and html files last xxx minutes
# (C) 2014 Rene Kreijveld, enail [at] renekreijveld [dot] nl
# Update 31-12-2013: only send email when changes are found
# Update 04-02-2014: check for new files last three hours
# Update 05-05-2014: check for new html files also
# Update 07-05-2014: filter out ju_chached and DirectAdmin stats folders in html files