Skip to content

Instantly share code, notes, and snippets.

@EHLOVader
EHLOVader / Off canvas drill down.js
Last active May 13, 2022 21:16 — forked from blift/OffCanvas.js
Drilldown menu for Wordpress sub pages. For Sage by Roots + TailwindCSS
function OffCanvas() {
const offOPen = document.getElementById('offcanvas__open');
const offMenu = document.getElementById('offcanvas__menu');
const body = document.body;
const offNav = document.querySelectorAll('.nav-secondary ul .menu-item');
// Open menu
offOPen.addEventListener('click', function () {
@EHLOVader
EHLOVader / valet-plus-destroy
Created February 10, 2020 22:04 — forked from dannygsmith/valet-plus-destroy
Remove valet-plus - reboot required
#!/usr/bin/env bash
#styles
VP_NONE='\033[00m'
VP_RED='\033[01;31m'
VP_GREEN='\033[01;32m'
VP_YELLOW='\033[01;33m'
VP_PURPLE='\033[01;35m'
VP_CYAN='\033[01;36m'
VP_WHITE='\033[01;37m'
#!/bin/bash
# Add Vagrant's hostupdater commands to sudoers, for `vagrant up` without a password
# force sudo on self.
if [ $( id -u ) -ne 0 ]; then
exec sudo -p "Login password for %p: " "$0" "$@"
exit $?
fi
# Stage updated sudoers in a temporary file for syntax checking
<?php
/**
* An helper file for Laravel 5, to provide autocomplete information to your IDE
* Generated for Laravel 5.0.4 on 2015-02-13.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {
#!/bin/bash
PID_FILE=/var/run/mailcatcher.pid
NAME=mailcatcher
PROG="/usr/bin/env mailcatcher"
USER=mailcatcher
GROUP=mailcatcher
start() {
echo -n "Starting MailCatcher"
<?php
public function subscribeEvents()
{
Backend::$events->addEvent('shop:onExtendCategoryModel', $this, 'extend_category_model');
}
public function extend_category_model($category, $context)
{
@EHLOVader
EHLOVader / Page.php
Last active December 25, 2015 15:58 — forked from anonymous/gist:7001873
<?php
foreach($products as $p){
echo $p->categories[0]->name . ' ' . $p->sku . ' ' . $p->created_at . ' </br>';
}
@EHLOVader
EHLOVader / gist:6902579
Last active December 25, 2015 02:29 — forked from GreatPotato/gist:6902395
Total number of items sold
<?php
$obj = new Shop_Product();
$obj->select('shop_products.id, sum(shop_order_items.quantity) AS "sold"');
$obj->join('shop_order_items', 'shop_products.id = shop_order_items.shop_product_id');
$obj->join('shop_orders', 'shop_order_items.shop_order_id = shop_orders.id');
$best_selling = $obj->where('shop_orders.payment_processed IS NOT NULL')->group('shop_products.id')->find_all();

Javascript Jabber
Your Prototype for Great Code

Shop Talk Show
Shoptalk is a podcast about front end web design, development and UX. Each week Dave & Chris will be joined by a special guest who is there to talk shop and help answer listener submitted questions.

Upfront Podcast
An in-depth discussion on the latest tooling, workflow and best practices for front-end developers, brought to you every week by Jack Franklin and Ben Howdle.

Accidental Dev

@EHLOVader
EHLOVader / install_vagrant_sudoers.sh
Created November 10, 2015 01:53 — forked from GUI/install_vagrant_sudoers.sh
Allow Vagrant sudo-access without password for NFS-setup (for OS X)
#!/bin/bash
# Script for placing sudoers.d files with syntax-checking
# Making a temporary file to contain the sudoers-changes to be pre-checked
TMP=$(mktemp -t vagrant_sudoers)
cat /etc/sudoers > $TMP
cat >> $TMP <<EOF
# Allow passwordless startup of Vagrant when using NFS.
Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/su root -c echo '*' >> /etc/exports