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
/** | |
* Smoothly scrolls the entire page body from top to bottom | |
* at a specified rate in pixels per second. | |
* | |
* @param {number} ratePxPerSecond - The scroll speed in pixels per second (e.g., 100). | |
*/ | |
function scrollDownAtRate(ratePxPerSecond) { | |
// Check for a valid rate | |
if (ratePxPerSecond <= 0) { | |
console.error("Scroll rate must be a positive number."); |
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
[data-tooltip] { | |
@apply relative; | |
&:before, | |
&:after { | |
@apply absolute opacity-0; | |
@apply opacity-0 transition-opacity duration-500; | |
content: ''; | |
left: 50%; | |
} |
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
RANDOM STRING 32 d6fBSJDVpQNymaMhgjWXMo0@bTS!9TxJ | |
Copied to clipboard. |
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
const oneDay = 60 * 60 * 24 * 1000 | |
const weekDays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] | |
const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] | |
const getTime = (date: Date) => { | |
const amPM = date.getHours() > 12 ? 'PM' : 'AM' | |
const time = [date.getHours() % 12, String(date.getMinutes()).padStart(2, '0')].join(':') | |
return time + ' ' + amPM | |
} |
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
"AAA" | |
"BAA" | |
"CAA" | |
"DAA" | |
"EAA" | |
"FAA" | |
"GAA" | |
"HAA" | |
"IAA" | |
"JAA" |
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
############ WordPress #################### | |
# Disable logging for favicon and robots.txt | |
location = /favicon.ico { | |
try_files /favicon.ico @empty; | |
access_log off; | |
log_not_found off; | |
expires max; | |
} |
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 { resolve } from 'path'; | |
import { readdir, stat, writeFile } from 'node:fs/promises'; | |
async function* getFiles(dir) { | |
const dirents = await readdir(dir, { withFileTypes: true }); | |
for (const dirent of dirents) { | |
const res = resolve(dir, dirent.name); | |
if (dirent.isDirectory()) { | |
yield* getFiles(res); | |
} else { |
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 { readdir, readFile, writeFile } from 'node:fs/promises'; | |
const parseDir = async (path, directoriesOnly) => { | |
return (await readdir(path, {withFileTypes: true})) | |
.filter(file => file.isDirectory() == directoriesOnly) | |
.map(file => file.name); | |
} | |
const determineImportExports = async ({dir, file}) => { | |
if ( file.endsWith('.vue') ) |
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 App\Filesystem\Adapters; | |
use Illuminate\Support\Carbon; | |
use Illuminate\Support\Facades\Http; | |
use Illuminate\Support\Str; | |
use League\Flysystem\Config; | |
use League\Flysystem\FileAttributes; | |
use League\Flysystem\FilesystemAdapter; |
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 | |
/** | |
* Generate unique combinations of an array... | |
*/ | |
function combinations($array) | |
{ | |
$return = []; | |
$num = count($array); | |
// The total number of possible combinations | |
$total = pow(2, $num); |
NewerOlder