I recently added this code to my utils package, so you are welcome to use it you want this. It's tree-shakable, so you don't have to worry about everything else!
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
const plugin = require("tailwindcss/plugin"); | |
module.exports = { | |
mode: "jit", | |
purge: { | |
content: ["./src/**/*.{js,ts,jsx,tsx,mdx,vue}"], | |
}, | |
theme: { extend: {} }, | |
variants: {}, | |
plugins: [ |
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
@props([ | |
'percentage' => 0, | |
'failed' => false | |
]) | |
@php | |
$done = $failed || $percentage == 100; | |
@endphp | |
<div {{ $attributes->merge(['class' => ' space-y-1'])->whereDoesntStartWith('wire:poll') }} |
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
git fetch origin | |
git checkout -b "source-branch" "origin/source-branch" | |
git checkout "origin/target-branch" | |
git merge --no-ff "source-branch" | |
git commit -m "Commit Message" | |
git push origin HEAD:target-branch |
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
git add . | |
git stash | |
git pull --rebase | |
git stash pop | |
git status | |
git commit | |
git push |
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
proxy_cache_path /tmp/cacheapi levels=1:2 keys_zone=microcacheapi:100m max_size=1g inactive=1d use_temp_path=off; | |
server { | |
listen 443 ssl http2 default_server; | |
listen [::]:443 ssl http2 default_server; | |
server_name example.com; | |
location /api/ { | |
# Rate Limiting | |
limit_req zone=reqlimit burst=20; # Max burst of request |
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
/** | |
* Time-to-live in seconds for cached requests. | |
*/ | |
const cacheTtl = 300; | |
/** | |
* List of request paths to cache. | |
*/ | |
const cachedPaths = [ |
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
/* debug.css | MIT License | zaydek.github.com/debug.css */ if (!("is_debugging" in window)) { is_debugging = false; var debug_el = document.createElement("style"); debug_el.append(document.createTextNode(`*:not(g):not(path) { color: hsla(210, 100%, 100%, 0.9) !important; background: hsla(210, 100%, 50%, 0.5) !important; outline: solid 0.25rem hsla(210, 100%, 100%, 0.5) !important; box-shadow: none !important; filter: none !important; }`)); } function enable_debugger() { if (!is_debugging) { document.head.appendChild(debug_el); is_debugging = true; } } function disable_debugger() { if (is_debugging) { document.head.removeChild(debug_el); is_debugging = false; } } !is_debugging ? enable_debugger() : disable_debugger(); |
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
/* | |
* Function for post duplication. Dups appear as drafts. User is redirected to the edit screen | |
*/ | |
function rd_duplicate_post_as_draft(){ | |
global $wpdb; | |
if (! ( isset( $_GET['post']) || isset( $_POST['post']) || ( isset($_REQUEST['action']) && 'rd_duplicate_post_as_draft' == $_REQUEST['action'] ) ) ) { | |
wp_die('No post to duplicate has been supplied!'); | |
} | |
/* |
NewerOlder