fx_get_state(string $key): mixed
fx_set_state(string $key, mixed $value): mixed
fx_no_state(string $key): bool
fx_state(string $key, mixed $default_value = NULL): mixed
This file contains hidden or 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
var html = function (text) { | |
return text | |
.replace(/&/g, '&') | |
.replace(/</g, '<') | |
.replace(/>/g, '>') | |
.replace(/"/g, '"') | |
.replace(/'/g, ''') | |
} | |
var userName = 'John' |
This file contains hidden or 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 | |
class Pluralize | |
{ | |
function pluralize($word) | |
{ | |
return $this->replaceWord( | |
$word, | |
$this->irregularSingles, | |
$this->irregularPlurals, |
This file contains hidden or 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 | |
function create_group($symbols, $prefix) | |
{ | |
return (object) [ | |
'tag' => 'group', | |
'symbols' => $symbols, | |
'prefix' => $prefix, | |
'key' => 0, | |
'used' => [] |
This file contains hidden or 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
import { patch, begin, end, text } from "./immediate.js"; | |
var count = 0; | |
function tick(event) { | |
if (event.type === "click") { | |
if (event.target.id === "increment") { | |
count++; | |
} else if (event.target.id === "decrement") { | |
count--; |
This file contains hidden or 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 tiny_blade; | |
function _replace(string $template): string | |
{ | |
// @endif | |
$template = preg_replace('/^\s*@(end.+?)\s*$/m', '<?php $1 ?>', $template); | |
// @if ($foo) | |
$template = preg_replace('/^\s*@(.+?)\s*$/m', '<?php $1: ?>', $template); |
This file contains hidden or 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 | |
/** | |
* @method static Tag a() | |
* @method static Tag audio() | |
* @method static Tag body() | |
* @method static Tag br() | |
* @method static Tag button() | |
* @method static Tag div() | |
* @method static Tag form() |
This file contains hidden or 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
function patch (current, next) { | |
if (current.isEqualNode(next)) { | |
return | |
} | |
if (current.nodeName !== next.nodeName) { | |
current.parentNode.replaceChild(current, next) | |
return | |
} | |
if (current.nodeType === 3) { | |
if (current.data !== next.data) { |
This file contains hidden or 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
.range { | |
position: relative; | |
height: 24px; | |
display: flex; | |
flex-direction: column; | |
justify-content: center; | |
cursor: default; | |
user-select: none; | |
} | |
.range:before { |
This file contains hidden or 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 | |
$file = 'path-to-file'; | |
$size = filesize($file); | |
$start = 0; | |
$end = $size - 1; | |
if (preg_match('/bytes=(\d+)-(\d*)/i', $_SERVER['HTTP_RANGE'] ?? '', $matches)) { | |
$start = $matches[1]; | |
if (!empty($matches[2])) { | |
$end = $matches[2]; | |
} |