Skip to content

Instantly share code, notes, and snippets.

View TakesTheBiscuit's full-sized avatar

Paul TakesTheBiscuit

View GitHub Profile
@TakesTheBiscuit
TakesTheBiscuit / abt-modify-prices.php
Created January 28, 2022 18:00
Woocommerce remove VAT for non GB / UK
<?php
/*
Plugin Name: Abikething modify pricing display
Plugin URI: http://pauldrage.co.uk
Description: This plugin over rides the pricing display to handle GB versus ROW for tax. Requires plugin woocommerce_set_country to set $_SESSION wc_country_iso
Version: 1.0.0
Author: Paul Drage
Author URI: http://pauldrage.co.uk
License: GPL2 etc
License URI: https://
@TakesTheBiscuit
TakesTheBiscuit / websocket.js
Created April 19, 2023 20:35
websocket.js using node and ws package
'use strict';
import { WebSocketServer } from 'ws';
const wss = new WebSocketServer({ port: 8080 });
wss.on('connection', function connection(ws) {
ws.on('error', console.error);
ws.on('message', function message(data) {
@TakesTheBiscuit
TakesTheBiscuit / vowels.js
Created April 20, 2023 16:10
Check for vowels in a string in javascript
const input = 'Hello World';
const filterArr = ['a','e','i','o','u'];
let counted = getCountFromFilteredInput(input,filterArr);
// 3
console.log(counted.length);
// ["e", "o", "o"]
console.log(counted);
// Passed
if (assertSame(counted.length, 3)) {
@TakesTheBiscuit
TakesTheBiscuit / form-filling.js
Last active July 2, 2023 19:36
form-filling.js
$('#someoneelse').click();
$('#patient_firstnames').val('Peter');
$('#patient_lastname').val('Drumda');
$('#patient_postcode').val('OX1 1AA');
$('#patient_dobd').val('01');
$('#patient_dobm').val('12');
$('#patient_doby').val('1981');
$('#patient_dob').val(${$('#patient_dobd').val()}/${$('#patient_dobm').val()}/${$('#patient_doby').val()});
$('#contact_female').click();
$('#proxy_relationship').val('Spouse');
@TakesTheBiscuit
TakesTheBiscuit / ImportProductsCommand.php
Created May 1, 2024 11:05 — forked from nicanaca0/ImportProductsCommand.php
Simple CSV Product importer for Sylius. Includes the product, the variant, channel pricing, taxons images and associations (1.0.0-beta.2)
<?php
namespace AppBundle\Command;
use Sylius\Component\Core\Model\ChannelPricingInterface;
use Sylius\Component\Core\Model\ProductInterface;
use Sylius\Component\Core\Model\ProductVariantInterface;
use Sylius\Component\Product\Model\ProductAssociationInterface;
use Sylius\Component\Product\Model\ProductAssociationTypeInterface;
use Sylius\Component\Taxonomy\Model\TaxonInterface;