Skip to content

Instantly share code, notes, and snippets.

@Antaru
Antaru / holidays.php
Last active December 6, 2022 00:35
Class to determine Swedish holidays based on year
<?php
class Holidays {
private $dates;
private $enum_dates = array(
'NEW_YEARS_DAY' => array('Nyårsdagen'),
'EPIPHANY' => array('Trettondedag jul', 'Trettondagen'),
'HOLY_THURSDAY' => array('Skärtorsdagen'),
'GOOD_FRIDAY' => array('Långfredag'),
@lukecav
lukecav / Query
Last active July 11, 2024 16:45
MySQL script to get all WooCommerce orders including metadata
select
p.ID as order_id,
p.post_date,
max( CASE WHEN pm.meta_key = '_billing_email' and p.ID = pm.post_id THEN pm.meta_value END ) as billing_email,
max( CASE WHEN pm.meta_key = '_billing_first_name' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_first_name,
max( CASE WHEN pm.meta_key = '_billing_last_name' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_last_name,
max( CASE WHEN pm.meta_key = '_billing_address_1' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_address_1,
max( CASE WHEN pm.meta_key = '_billing_address_2' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_address_2,
max( CASE WHEN pm.meta_key = '_billing_city' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_city,
max( CASE WHEN pm.meta_key = '_billing_state' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_state,
@mnghn07
mnghn07 / gitCommitEmoji.md
Created August 10, 2020 10:32
Git Commit Message Emoji