Skip to content

Instantly share code, notes, and snippets.

View meNeither's full-sized avatar

René Schulze meNeither

View GitHub Profile
@scottjehl
scottjehl / whichones.js
Created August 21, 2020 15:40
which elements are wider than the viewport?
var list = [];
document.querySelectorAll("body *")
.forEach(function(elem){
if(elem.getBoundingClientRect().width > document.body.getBoundingClientRect().width){
list.push(elem.outerHTML.split('>')[0] + '>');
}
});
confirm( "these elements are wider than the viewport:\n\n " + list.join("\n") )
@maddisondesigns
maddisondesigns / functions.php
Last active August 5, 2025 09:32
WooCommerce Custom Fields for Simple & Variable Products
/*
* Add our Custom Fields to simple products
*/
function mytheme_woo_add_custom_fields() {
global $woocommerce, $post;
echo '<div class="options_group">';
// Text Field
/**
* Generic thing-in-orbit-around-a-thing class.
* Has properties to store orbital elements as well as functions to calculate
* them from whatever data is available.
*/
function SoI(name, position, velocity, mass, parentSOI) {
this._name = name
this._position = position
this._velocity = velocity
this._mass = mass