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
| db.aggregate([{ | |
| $replaceRoot: { | |
| newRoot: { | |
| _id: '$_id', | |
| data: { | |
| $objectToArray: '$$ROOT' | |
| } | |
| } | |
| } | |
| }, |
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
| #!/bin/sh | |
| /usr/lib/plexmediaserver/Plex\ Media\ Server \ | |
| --sqlite /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Plug-in\ Support/Databases/com.plexapp.plugins.library.db \ | |
| "UPDATE metadata_items SET added_at = created_at WHERE added_at > strftime('%s', 'now');" |
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
| router id x; | |
| protocol bgp as62240 { | |
| local as 209808; | |
| source address x; | |
| neighbor x as 62240; | |
| import all; | |
| export filter { | |
| if net ~ [2a06:e881:5404::/48] then accept; |
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 ref="container"></div> | |
| </template> | |
| <script> | |
| export default { | |
| data() { | |
| return { id: null }; | |
| }, |
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
| navigator.serviceWorker && navigator.serviceWorker.getRegistrations().then(rs => { | |
| rs.forEach(r => { | |
| if (r.active && r.active.scriptURL.includes('arc-sw.js')) { | |
| r.unregister() | |
| } | |
| }); | |
| }); |
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 injectAdSense() { | |
| const script = document.createElement('script'); | |
| script.src = 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js'; | |
| script.async = true; | |
| script.setAttribute('data-ad-client', 'ca-pub-XXXXXXXXXXXXXXXX'); | |
| document.head.appendChild(script); | |
| } |
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> | |
| <span v-for="n in 5" :key=n> | |
| <fa | |
| :icon="[rating >= n ? 'fas' : 'far', 'star']" | |
| @mouseover="rating = n" | |
| @mouseleave="rating = 0" | |
| @click="$emit('rated', rating)" | |
| /> | |
| </span> |
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
| local shard_id = tonumber(ARGV[3]) | |
| local shard_count = tonumber(ARGV[2]) | |
| local prefix = 'cache:' .. ARGV[1] .. ':' | |
| local keys = redis.call('keys', prefix .. '*') | |
| local deleted = 0 | |
| for i,v in pairs(keys) do | |
| local key = keys[i] | |
| local guild_id = string.sub(key, #prefix + 1) |
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 { toBigIntBE, toBufferBE } from 'bigint-buffer'; | |
| export function encode(hash: string) { | |
| const buffer = Buffer.from(hash, "hex"); | |
| return [toBigIntBE(buffer.slice(0, 8)), toBigIntBE(buffer.slice(8, 16))]; | |
| } | |
| export function decode(first: bigint, second: bigint) { | |
| const buffer1 = toBufferBE(first, 8); |
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
| use warp::Filter; | |
| use dotenv::dotenv; | |
| use std::env; | |
| #[tokio::main] | |
| async fn main() { | |
| dotenv().ok(); | |
| let port = env::var("PORT") | |
| .expect("Port not found") |