Skip to content

Instantly share code, notes, and snippets.

@adrianhajdin
adrianhajdin / constants.js
Created March 3, 2023 09:28
Build and Deploy an Amazing 3D Web Developer Portfolio with ThreeJS | React Three Fiber
import {
mobile,
backend,
creator,
web,
javascript,
typescript,
html,
css,
reactjs,
@RobertAKARobin
RobertAKARobin / safari.md
Last active December 5, 2024 01:38
Safari's date-picker is the cause of 1/3 of our customer support issues

Safari's date-picker is the cause of 1/3 of our customer support issues

...and obviously we're building a workaround. But I'm absolutely flabbergasted that a standard <input type="date"> HTML field, in a standard browser, from a company that bases its reputation good design, could be so dreadful.

The context

I'm the developer for a startup that sells a genetic test to recommend medications for high blood pressure. For medical reasons we need to know our customers' birth date. Most of our customers are in their 60s or older. We've found that many of them use iPads or iPhones. And they're the ones who complain to our customer support that our site is unusable.

The problem

@amboutwe
amboutwe / yoast_seo_opengraph_change_image_size.php
Last active October 28, 2024 06:15
Code snippet to change or remove OpenGraph output in Yoast SEO. There are multiple snippets in this code.
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Change size for Yoast SEO OpenGraph image for all content
* Credit: Yoast Development team
* Last Tested: May 19 2020 using Yoast SEO 14.1 on WordPress 5.4.1
* Accepts WordPress reserved image size names: 'thumb', 'thumbnail', 'medium', 'large', 'post-thumbnail'
* Accepts custom image size names: https://developer.wordpress.org/reference/functions/add_image_size/
*/
@dlucero23
dlucero23 / WooCommerceaccountpagestyle.css
Last active June 24, 2018 00:33
Custom CSS for WooCommerce Account Page Built in Cornerstone
/*
No need for style tags here;
simply get started by writing
CSS! Watch as your changes
are reflected live in the
preview area. Have fun!
*/
.woocommerce-MyAccount-navigation-link a {
margin: 5px 5px 0 0;
padding: 15px;
@BFTrick
BFTrick / functions.php
Created May 26, 2016 15:05
WooCommerce add an Empty Cart button
<?php
// check for empty-cart get param to clear the cart
add_action( 'init', 'woocommerce_clear_cart_url' );
function woocommerce_clear_cart_url() {
global $woocommerce;
if ( isset( $_GET['empty-cart'] ) ) {
$woocommerce->cart->empty_cart();
}
}
@gokulkrishh
gokulkrishh / media-query.css
Last active December 21, 2024 11:12
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@paulirish
paulirish / what-forces-layout.md
Last active December 24, 2024 07:21
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@mcguffin
mcguffin / acf-get-field-key.php
Last active June 13, 2023 13:32
WordPress Advanced Custom Fields get field key from field name
<?php
/**
* Get field key for field name.
* Will return first matched acf field key for a give field name.
*
* ACF somehow requires a field key, where a sane developer would prefer a human readable field name.
* http://www.advancedcustomfields.com/resources/update_field/#field_key-vs%20field_name
*
* This function will return the field_key of a certain field.
@strangerstudios
strangerstudios / pmpro_currencies_ruble.php
Last active April 14, 2021 19:25
Add Russian Ruble to PMPro currencies.
function pmpro_currencies_ruble($currencies)
{
$currencies['RUB'] = __('Russian Ruble (RUB)', 'pmpro');
return $currencies;
}
add_filter('pmpro_currencies', 'pmpro_currencies_ruble');
@staltz
staltz / introrx.md
Last active December 20, 2024 15:49
The introduction to Reactive Programming you've been missing