Skip to content

Instantly share code, notes, and snippets.

View bossanova808's full-sized avatar

Jeremy Daalder bossanova808

View GitHub Profile
# Use these shorthands:
#
# @reboot Run once, at startup.
# @yearly Run once a year, "0 0 1 1 *".
# @annually (same as @yearly)
# @monthly Run once a month, "0 0 1 * *".
# @weekly Run once a week, "0 0 * * 0".
# @daily Run once a day, "0 0 * * *".
# @midnight (same as @daily)
# @hourly Run once an hour, "0 * * * *".
@bossanova808
bossanova808 / commerce.php
Created October 18, 2016 23:13
Example working Craft Commerce config file for payment details
<?php
// This controls and contains what keys/passwords are used for dev/live environments.
return [
// THIS * ENTRY MUST BE PRESENT - EVEN IF EMPTY!
'*' => array(
),
// DEV Details - i.e. your Paypal sandbox details for example
@bossanova808
bossanova808 / remove-theaustralian-paywall.js
Created February 17, 2019 04:40
Userscript to Remove The Australian paywall.
// ==UserScript==
// @name Remove The Australian Paywall
// @version 1
// @grant none
// @match *://www.theaustralian.com.au/*
// ==/UserScript==
window.addEventListener('load', function() {
console.log("Removing the Australian paywall overlay...");
@bossanova808
bossanova808 / addUserToGroupOnPurchase.php
Created October 7, 2019 02:50
Craft Commerce add user to group on product purchase
public function onAfterCompleteOrderHandler($event)
{
// @var Order $order
$order = $event->sender;
// LOGIC FOR SPECIFIC ITEM PURCHASES
$newGroups = [];
foreach ($order->lineItems as $lineItem) {
(jeremy@JD-WORK-PC) 13:46 /var/www/vhosts/c4-dev $ ddev debug test
Running bash [-c /tmp/test_ddev.sh]
OS Information: Linux JD-WORK-PC 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
User information: uid=1000(jeremy) gid=1000(jeremy) groups=1000(jeremy),4(adm),20(dialout),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),117(netdev),1001(docker)
DDEV version: ITEM VALUE
DDEV version v1.21.1
architecture amd64
db drud/ddev-dbserver-mariadb-10.4:v1.20.0
dba phpmyadmin:5
ddev-ssh-agent drud/ddev-ssh-agent:v1.20.0