This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
switch ( $item_type ) { | |
case 'line_item': | |
case 'product': | |
$classname = 'WC_Order_Item_Product'; | |
break; | |
case 'coupon': | |
$classname = 'WC_Order_Item_Coupon'; | |
break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** Tell WordPress to load the WordPress theme and output it. */ | |
define('WP_USE_THEMES', true); | |
/** Load the WordPress Environment and Template. */ | |
require __DIR__ . '/project/wp-blog-header.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jq -r 'paths(scalars) as $p | ($p | join(".")) + " = " + (getpath($p)|tostring)' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
declare(strict_types=1); | |
const INDENT_CHAR = ' '; | |
const INDENT_SIZE = 4; | |
const END_OF_LINE = "\n"; | |
function exitWith(int $exitStatus, string $message): void |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Grammar\Hungarian; | |
class DefiniteArticle | |
{ | |
const CONSONANTS = [ | |
'0', | |
'2', | |
'3', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# File with a string of UTF-8 characters | |
FILE="$1" | |
paste <(cat "${FILE}" | iconv -f UTF-8 -t UNICODE | hexdump -s 2 -e '1/2 "U+%04X\n"') <(grep -o '.' "${FILE}") \ | |
| sort |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
REDIS_DB="0" | |
QUEUE_REDIS_KEY="app_name_database_queues:default:delayed" | |
DB_NAME="sql_db_name" | |
redis() | |
{ | |
redis-cli -n "${REDIS_DB}" --raw "$@" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.querySelector("#container video.html5-main-video").onwaiting = (event) => { | |
var to; | |
var cnt = 0; | |
var ov = event.target.volume; | |
if (document.querySelector("#movie_player.ad-created") === null) { | |
return; | |
} | |
to = setTimeout(() => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Calculate standard deviation | |
* | |
* Square root of sum of squares divided by N-1 | |
* | |
* @param list<float> $values | |
*/ | |
function sd(array $values): float |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link | |
rel='stylesheet' | |
id='wp-block-library-css' | |
href='https://example.com/wp-includes/css/dist/block-library/style.min.css' | |
media='all' | |
> | |
<?php | |
// Unconditional inclusion in core | |
function wp_common_block_scripts_and_styles() |
NewerOlder