Skip to content

Instantly share code, notes, and snippets.

View nlssn's full-sized avatar
💻
clicketyclackin'

Johannes Nilsson nlssn

💻
clicketyclackin'
View GitHub Profile
@helgatheviking
helgatheviking / custom-meta-for-woocommerce-product-variations.php
Last active January 31, 2024 23:06
Add custom fields to WooCommerce variations
<?php
/**
* Plugin Name: Example custom variation meta for WooCommerce
* Plugin URI: hhttps://www.kathyisawesome.com/add-custom-meta-fields-to-woocommerce-variations/
* Description: Add thickness and diameter fields to variations.
* Version: 6.22.5
* Author: Kathy Darling
* Author URI: https://kathyisawesome.com/
*
* Text Domain: extra-product-data
@EtienneR
EtienneR / user.js
Created January 7, 2016 23:39
XMLHttpRequest RESTful (GET, POST, PUT, DELETE)
// Get all users
var url = "http://localhost:8080/api/v1/users";
var xhr = new XMLHttpRequest()
xhr.open('GET', url, true)
xhr.onload = function () {
var users = JSON.parse(xhr.responseText);
if (xhr.readyState == 4 && xhr.status == "200") {
console.table(users);
} else {
console.error(users);