Skip to content

Instantly share code, notes, and snippets.

View molotovbliss's full-sized avatar
⚗️
Code, Eat, Sleep++;

Jared molotovbliss

⚗️
Code, Eat, Sleep++;
  • DFW, Texas
View GitHub Profile
@molotovbliss
molotovbliss / xeogl-debug-logPick.js
Last active February 18, 2021 21:28 — forked from xeolabs/xeogl-debug-logPick.js
Drop in Chrome console to log info on each (pickable) Entity you click on -- #xeogl #debugging
(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 / jnewfiles
Created April 27, 2019 00:11 — forked from renekreijveld/jnewfiles
Bash script to detect new and changed php and html files last 3 hours. Skips cache directories.
#!/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
@molotovbliss
molotovbliss / jnewfiles
Created April 27, 2019 00:11 — forked from renekreijveld/jnewfiles
Bash script to detect new and changed php and html files last 3 hours. Skips cache directories.
#!/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
@molotovbliss
molotovbliss / m2-module-install-2.sh
Created April 21, 2017 15:59 — forked from davidalger/m2-module-install-2.sh
Install module directly or via composer
composer config repositories.alger/phpworld-talk2 vcs git@github.com:davidalger/phpworld-talk2.git
composer require alger/module-skeleton:dev-master
bin/magento setup:upgrade -q && bin/magento cache:flush -q
# OR
git clone git@github.com:davidalger/phpworld-talk2.git app/code/Alger/Skeleton
bin/magento module:enable Alger_Skeleton
bin/magento setup:upgrade -q && bin/magento cache:flush -q
@molotovbliss
molotovbliss / watchdo.sh
Last active June 8, 2023 15:55 — forked from mikesmullin/watch.sh
watchdo: Linux bash script to monitor file modifications recursively & execute bash commands as changes occur
#!/usr/bin/env bash
# script: watchdo
# author: Mike Smullin <mike@smullindesign.com>
# modified: Jared Blalock <mb@molotovbliss.com>
# possible use for monitoring .less changes to compile to .css
# license: GPLv3
# description:
# watches the given path for changes
# and executes a given command when changes occur
# usage:
@molotovbliss
molotovbliss / compare_and_email.sh
Created September 28, 2016 23:18 — forked from davidalger/compare_and_email.sh
Uses git to detect changes in web root and email administrators daily
#!/bin/env bash
#
# Example use: Add the following line to your crontab to run the script on a daily basis.
#
# 1 6 * * * ~/bin/compare_and_email.sh <full_path_to_webroot> "Email Subject Line" "user@example.com user2@example.com"
#
date=`date +%Y%m%d`
gitdir="$1"
subject="$2"
@molotovbliss
molotovbliss / gist:ab96de0ab5f208c1434e
Last active February 16, 2016 02:40 — forked from americkson/gist:17c1ffaeafa4a41eccef
Magento Enterprise 1.14 Clear Product Data
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE TABLE `catalog_product_bundle_option`;
TRUNCATE TABLE `catalog_product_bundle_option_value`;
TRUNCATE TABLE `catalog_product_bundle_price_index`;
TRUNCATE TABLE `catalog_product_bundle_selection`;
TRUNCATE TABLE `catalog_product_bundle_selection_price`;
TRUNCATE TABLE `catalog_product_bundle_stock_index`;
TRUNCATE TABLE `catalog_product_entity_datetime`;
TRUNCATE TABLE `catalog_product_entity_decimal`;
TRUNCATE TABLE `catalog_product_entity_gallery`;
@molotovbliss
molotovbliss / gist:11afd49aefad10103133
Created December 25, 2015 10:07 — forked from alistairstead/gist:1053331
Find bad things in Magento customisations
find . -name "*.phtml" -print | xargs grep --color=auto -iRnH "Mage::getModel("
find . -name "*.phtml" -print | xargs grep --color=auto -iRnH "Mage::getResourceModel("
find . -name "*.phtml" -print | xargs grep --color=auto -iRnH "Mage::getSingleton("
find . -name "*.phtml" -print | xargs grep --color=auto -iRnH "SELECT.*FROM.*;[\"\']"
find . -name "*.php" -print | xargs grep --color=auto -iRnH "htmlEscape("
find ./app/code/local -name "*.php" -print | xargs grep --color=auto -iRnH "htmlEscape("
find ./app/code/local -name "*/Block/*.phtml" -print | xargs grep --color=auto -iRnH "SELECT.*FROM.*;[\"\']"
find ./app/code/local -name "*.php" -print | xargs grep --color=auto -iRnH "\$_[GET|REQUEST|SERVER|POST]"
find ./app/code/local -name "*.php" -print | xargs grep --color=auto -iRnH "public _construct"
find . -name "*.php" -print | xargs grep --color=auto -iRnH "public _construct"
@molotovbliss
molotovbliss / cronlist.php
Last active December 17, 2015 18:57 — forked from werdan/Magento cron lister
Lists all Magento cron jobs with tables output
<?php
// shell/listAllCron.php
require_once 'abstract.php';
class Mage_Shell_CronLister extends Mage_Shell_Abstract
{
public function run()
{
$cronJobs = Mage::app()->getConfig()->getNode('crontab/jobs');
<?php
$database_host = "localhost";
$database_user = "username";
$database_password = "password";
$magento_database = "databasename";
$table_prefix = "prefixhere_";
$dryrun = true; // change to false when you want to commit changes
$db = mysql_connect($database_host, $database_user, $database_password);