Skip to content

Instantly share code, notes, and snippets.

View ctuxboy's full-sized avatar

Christophe Hollebeke ctuxboy

View GitHub Profile
@Achterstraat
Achterstraat / Vimexx.php
Last active July 25, 2023 08:50
Heb je het óók he-le-maal gehad met Vimexx? Gebruik dan dit script om makkelijk én snel de overstap te realiseren, alle data binnen enkele seconden over naar je nieuwe hostingpartij!
<?php
/*
First, create API Projects at https://www.vimexx.nl/api
Second, replace all vars between [] with credentials from previous step!
Third, see below;
$vimexx = (new \Vimexx([account], 'wefact'));
var_export($vimexx->post('/domains'));
var_dump($vimexx->client('whmcs')->post('/domain/dns', ['sld' => 'achterstraat', 'tld' => 'com']));
var_export($vimexx->client('wefact')->post('/domains'));
*/
@sunsetsonwheels
sunsetsonwheels / test.html
Created August 10, 2019 13:18
'Pages' nav in KaiOS
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,user-scalable=no">
<title>"Pages" in KaiOS</title>
<link rel="stylesheet" href="./window.css">
</head>
<body>
<header class="header">
@brickbones
brickbones / wordpress-page-temaplate.php
Created April 20, 2019 18:07
WordPress page template with API (javascript and php)
<?php /* Template Name: Awesome Page */
get_header();
?>
<div class="latest-posts"></div>
<script>
@sybrew
sybrew / hello.class.php
Last active July 24, 2016 19:08
Hello Dolly OOP example (untested)
<?php
/*
Plugin Name: Hello Dolly OOP example
Plugin URI: https://wordpress.org/plugins/hello-dolly/
Description: This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong: Hello, Dolly. When activated you will randomly see a lyric from <cite>Hello, Dolly</cite> in the upper right of your admin screen on every page.
Author: Matt Mullenweg (and set to OOP by Sybre Waaijer)
Version: 1.6.oop
Author URI: http://ma.tt/
*/
@narodnaia
narodnaia / disable-payment-methods-when-free-shipping-available.php
Last active August 11, 2016 18:46
Woocommerce - Disable all payment methods but free shipping and local pickup when free shipping is available
<?php
function my_hide_shipping_when_free_is_available( $rates ) {
$free = array();
foreach ( $rates as $rate_id => $rate ) {
if ( 'free_shipping' === $rate->method_id ) {
$free[ $rate_id ] = $rate;
break;
}
}
foreach ( $rates as $rate_id => $rate ) {
@mikejolley
mikejolley / functions.php
Last active May 17, 2021 13:51
WooCommerce - Split shipping class items into a new package and limit shipping methods
/**
* This function loops over cart items, and moves any item with shipping class 'special-class' into a new package.
* The new package in this example only takes flat rate shipping.
*/
function split_special_shipping_class_items( $packages ) {
$found_item = false;
$special_class = 'special-class'; // edit this with the slug of your shippig class
$new_package = current( $packages );
$new_package['contents'] = array();
$new_package['contents_cost'] = 0;
@danielpataki
danielpataki / basics.php
Last active April 5, 2019 13:00
Creating a Plugin
<?php
/**
* Plugin Name: My Facebook Tags
* Plugin URI: http://danielpataki.com
* Description: This plugin adds some Facebook Open Graph tags to our single posts.
* Version: 1.0.0
* Author: Daniel Pataki
* Author URI: http://danielpataki.com
* License: GPL2
*/
@jameskoster
jameskoster / functions.php
Created October 7, 2013 21:24
WooCommerce - add text after price
add_filter( 'woocommerce_get_price_html', 'custom_price_message' );
function custom_price_message( $price ) {
$vat = ' (plus VAT)';
return $price . $vat;
}
@hofmannsven
hofmannsven / README.md
Last active May 3, 2024 15:30
Git CLI Cheatsheet
@tinotriste
tinotriste / breadcrumbs-functions.php
Last active April 20, 2024 05:36
Wordpress: Breadcrumbs function
<?php
/*=============================================
= BREADCRUMBS =
=============================================*/
// to include in functions.php
function the_breadcrumb() {
$sep = ' > ';