Skip to content

Instantly share code, notes, and snippets.

@runezero
runezero / createTask.php
Last active July 26, 2023 09:34
[Create PrimaryPayer Update List] Create a list of Business Central paying customers to update based on the given Mandate data and customer number #billybird
<?php
/* Class: Twikeyservice */
$data = $this->getCompletedMandates();
$result = [];
foreach ($data as $row) {
$order = json_decode($row->data, true);
$order['person']['phone'] = Api::validateMobileNumber($order['person']['phone'] ?? "");
$result[] = [$order['person'], $row->customer_number, $row->location];
$updateParams = [$order['person'], $row->customer_number, $row->location];
@runezero
runezero / GW_Edit_Products.php
Last active December 12, 2022 19:09
[Entry enable product edit] Enable the field edit function for product fields in Gravity Form entries #gravityforms
<?php
/**
* Gravity Wiz // Gravity Forms // Edit Products & Payment Details
*
* Edit products (and payment details) via the Gravity Forms Edit Entry view.
*
* @version 1.3
* @author David Smith <[email protected]>
* @license GPL-2.0+
* @link http://gravitywiz.com/
@runezero
runezero / postman.js
Created December 9, 2022 08:12
[Postman Current Date Time] Set a Postman global variable with the current Date and Time in a single variable #tools
const moment = require('moment');
pm.globals.set("currentTime", moment().format("YYYY-MM-DDTHH:mm:ssZ"));
//2022-12-09T09:11:50+01:00
@runezero
runezero / dsm_custom_sub_header_bar.php
Created October 17, 2022 18:56
[Intrax search bar] The custom search bar for Intrax for searching on car brand/models #woocommerce
add_shortcode('dsm_custom_sub_header_bar', 'dsm_custom_sub_header_bar_func');
function dsm_custom_sub_header_bar_func()
{
global $woocommerce;
$cat_args = array(
'orderby' => 'name',
'order' => 'asc',
'hide_empty' => true,
'parent' => 0
@runezero
runezero / display_images.php
Last active October 11, 2022 21:21
[Serve images from site] Print the image links from a directory #tools
<?php
$id = $_GET['id'];
$path = getcwd() .'/' . $id . "/";
$files = scandir($path);
foreach($files as $key => $file){
if($file == "." || $file == ".."|| $file == "original"){
continue;
@runezero
runezero / content_save_pre.php
Created October 10, 2022 18:26
[Enfold Exerpt correction ALB] fix the content exerpt from ALB built pages #enfold
add_filter('content_save_pre', 'dsm_content_save_pre_enfold_alb', 100, 1);
function dsm_content_save_pre_enfold_alb($content)
{
if (is_admin()) {
$post_id = get_the_ID();
$post_type = get_post_type($post_id);
if ($post_type == 'post') {
$builder_stat = Avia_Builder()->get_alb_builder_status($post_id);
if (('active' == $builder_stat) && !is_preview()) {
@runezero
runezero / index.html
Last active September 22, 2022 15:11
[Zoomable image canvas] a zoomable map for displaying image maps #tools
<!-- This is a very basic canvas example which allows for panning and zooming using a mouse (Click & drag & scrollwheel) or touchscreen (tap and drag to pan, pinch to zoom). -->
<body>
<canvas id="canvas"></canvas>
</body>
@runezero
runezero / laravelconfig.txt
Created September 16, 2022 15:05
[Laravel to production] Basic SFTP steps to produce a Laravel website #tools
#Laravel bestanden zetten
- zet boven de public directory een nieuwe directory neer met een algemene installatie naam
- verplaats alle bestanden van het laravel project naar de nieuwe server directory opna de Public directory
- verplaats de bestanden uit de Public directory van het laravelproject naar de public directory van de server
#Bestandspaden naar het project goedzetten
- Open het bestand: <Server>/public/index.php
- Zet alle paden naar de bestanden binnen deze file naar de juiste sub directory "../<laravel_installatie>/storage"
#ENV settings in het project goedzetten
@runezero
runezero / tablepress.css
Created September 1, 2022 14:11
[Tablepress styling] A basic styling for tablepress with exclusions for multisite #wordpress
.tablepress {
font-size: 12px;
}
.tablepress thead .column-1 {
border-top-left-radius: 20px;
}
.tablepress thead tr th:last-child {
border-top-right-radius: 20px;
@runezero
runezero / manage_edit-shop_order_columns.php
Created July 26, 2022 13:29
[Display products in order table] Shows the purchased products in the admin order table #woocommerce
add_filter( 'manage_edit-shop_order_columns', 'dev_show_product_order',15 );
function dev_show_product_order($columns){
//add column
$columns['product-display'] = __( 'Products');
return $columns;
}
add_action( 'manage_shop_order_posts_custom_column' , 'dev_custom_shop_order_column', 10, 2 );