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
<script setup> | |
import { onClickOutside } from '@vueuse/core' // Optional | |
import { | |
nextTick, | |
onMounted, | |
ref, | |
watch, | |
} from 'vue' | |
import { PagedRequest } from '~/shared/models/PagedRequest' // Assuming this path is correct in your project |
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
public static class BatchOperations | |
{ | |
public static async Task Process<T>(int batchSize, IReadOnlyList<T> items, Func<IReadOnlyList<T>, Task> processBatch) | |
{ | |
var processed = 0; | |
while(processed < items.Count) | |
{ | |
var batch = items.Skip(processed).Take(batchSize).ToList(); | |
await processBatch(batch); | |
processed += batchSize; |
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
# define a count variable | |
$count = 0 | |
# get first argument | |
$source = $args[0] | |
mkdir("../$source") | |
Get-ChildItem -Recurse -Filter "*.$source" | ForEach-Object { | |
# $json = Get-Content $_ -Raw | ConvertFrom-Json | |
# $json | ConvertTo-Json | Set-Content $_ | |
Write-Host "Move to: ../$source/$($_.FullName | Split-Path -Leaf)" | |
$_.MoveTo("../$source/$($_.FullName | Split-Path -Leaf)") |
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
<template> | |
<div id="app"> | |
<div class="p-4 g-4 d-flex align-items-center"> | |
<label class="p-0 m-0" for="">Rows</label> | |
<input v-model.number="rows" :min="2" :max="20" type="range" class="form-control ml-2 mr-4 m-0"> | |
<label class="p-0 m-0" for="">Columns</label> | |
<input v-model.number="cols" min="2" step="1" max="20" type="range" class="form-control ml-2 m-0"> | |
<button class="btn btn-primary ml-4" @click="regenKey">Regenerate!</button> | |
</div> | |
<table class="table-bordered" :key="key"> |
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 song = document.body.querySelectorAll( ".dropdown-trigger.ytmusic-menu-renderer" ) | |
for ( var i = 0; i < song.length; i++ ) { | |
song[i].click(); var dropdown = document.body.querySelector( "ytmusic-menu-popup-renderer[slot='dropdown-content']" ) | |
if ( dropdown != undefined ) { | |
var items = dropdown.querySelector( "tp-yt-paper-listbox#items" ).querySelectorAll( "ytmusic-menu-service-item-renderer" ) | |
if ( items != null ) { | |
items.forEach( async ( element ) => { | |
if ( element.querySelector( 'yt-formatted-string' ).innerHTML == 'Remove from playlist' ) { |
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
... | |
'padding-line-between-statements': [ | |
'error', | |
{ | |
blankLine: 'always', | |
prev: [ | |
'multiline-const', 'multiline-let', 'multiline-var', 'multiline-block-like', 'return', 'multiline-expression', | |
], | |
next: '*', | |
}, |
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
fake() { | |
if [[ -z $1 ]]; then | |
echo "Provide a chance generator:" | |
exit 1 | |
fi | |
tocopy=$(chance "$@") | |
echo $tocopy | |
echo $tocopy | tr -d '\n' | pbcopy | |
echo "\nCopied 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 dynamicMiddleware = require( 'express-dynamic-middleware' ) | |
const jsonServer = require( "json-server" ) | |
const jsonFile = "db.json" | |
const server = jsonServer.create() | |
let router = jsonServer.router( jsonFile ) | |
let dynamicRouter = dynamicMiddleware.create( router ) | |
const defaults = jsonServer.defaults() |
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
{ | |
"editor.fontSize": 13, | |
"editor.fontFamily": "'JetBrains Mono', monospace", | |
"editor.tabSize": 2, | |
"editor.detectIndentation": false, | |
"editor.renderLineHighlight": "all", | |
"editor.showFoldingControls": "always", | |
"editor.smoothScrolling": true, | |
"editor.stablePeek": false, | |
"emmet.includeLanguages": { |
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 compareVersions from 'compare-versions'; | |
fetch(process.env.BASE_URL + `version.json?_d=` + encodeURI(new Date().toJSON()), { | |
method: "GET", | |
headers: { | |
"pragma": "no-cache", | |
"cache-control": "no-store" | |
} | |
}) | |
.then(resp => resp.json()) | |
.then(json => { |
NewerOlder