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") |
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
[ | |
{ | |
"ip": "185.50.107.211", | |
"dns": "brazil0.discord.gg", | |
"city": "Cotia", | |
"region": "São Paulo", | |
"country": "BR", | |
"org": "AS49544 i3D.net B.V" | |
}, | |
{ |
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
declare class ProtoMessage { | |
serializeBinary(): Uint8Array; | |
static deserializeBinary(bytes: Uint8Array): any; | |
} | |
export default class ProtoMap<K, V extends ProtoMessage> { | |
private map: Map<K, ReturnType<ProtoMessage["serializeBinary"]>> = new Map; | |
constructor(private message: typeof ProtoMessage) {} |
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
syntax = "proto3"; | |
package discord; | |
message Icon { | |
bytes hash = 1; | |
bool animated = 2; | |
} | |
message Guild { | |
string name = 2; |
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 protobuf = require('protobufjs'); | |
const sizeof = require('object-sizeof'); | |
protobuf.load("invite.proto", (err, root) => { | |
const Invite = root.lookupType("prototest.Invite"); | |
const payload = { | |
code: 'vexera', | |
guild_id: 228838562500575233n, | |
guild_name: 'Vexera Official', |
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 puppeteer = require('puppeteer'); | |
async function getLyrics(url) { | |
const browser = await puppeteer.launch({ headless: false }); | |
const [page] = await browser.pages(); | |
await page.setRequestInterception(true); | |
page.on('request', request => { | |
if (request.resourceType() === 'script') |