Все Новый

user:thomas фрагментов создано пользователем

title:mygist фрагментов с указанным заголовком

description:sync gists with given description

filename:myfile.txt фрагменты содержащие файлы с указанным именем

extension:yml фрагменты, содержащие файлы с указанным расширением

language:go фрагменты, содержащие файлы с указанным языком

topic:homelab фрагменты с заданной темой

all:systemctl search all fields

Регистрация

Войти

Все Новый Регистрация Войти

nuno

Зарегистрирован 2 months ago

Свежие сверху по дате создания
Свежие снизу по дате создания
Свежие сверху по дате обновления
Свежие снизу по дате обновления
Все фрагменты 570

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 2 weeks ago
1 /**
2 * CharacterRegistry — central lookup for Character objects.
3 *
4 * Usage:
5 * import { CharacterRegistry } from "@registry/CharacterRegistry";
6 *
7 * const char = CharacterRegistry.find("«Flash»");
8 * const chars = CharacterRegistry.forUser("flash");
9 * const active = CharacterRegistry.getActive("flash");
10 */

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 2 weeks ago
1 function buildEntries(nation: Nation, week: WRankWeek): LeaderboardEntry[] {
2 const wRankEntries = WRank.entriesForNation(nation, week);
3
4 return wRankEntries.map((wr): LeaderboardEntry => {
5 const char = wr.character;
6
7 // Aggregate K/D and stats from all active slots this week
8 let totalKills = 0;
9 let totalDeaths = 0;
10 let totalAtk = 0;

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 2 weeks ago
1 /**
2 * Bulk emoji upload script with subdirectory support and round-robin distribution.
3 *
4 * Usage:
5 * Upload: npx ts-node -r tsconfig-paths/register scripts/upload-emojis.ts [emoji_dir]
6 * Delete: npx ts-node -r tsconfig-paths/register scripts/upload-emojis.ts --delete <pattern>
7 * Pattern can be a prefix (e.g. "wrank_up") or exact name (e.g. "wrank_up_1")
8 * Multiple patterns: --delete wrank_up wrank_down wrank_gold
9 *
10 * Directory naming conventions:

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 2 weeks ago
1 export namespace score {
2 /**
3 * Resolve, validate and persist a score submission for a given userKey.
4 * Used by both the slash command handler and the modal submit handler.
5 */
6 export async function submitForUser(input: ScoreSubmitInput): Promise<ScoreSubmitResult> {
7 const { userKey, pts, k, d, atk, def, heal, submittedByOfficer = false } = input;
8
9 const { char, borrowedFrom } = getEffectiveCharacter(userKey);
10 if (!char) {

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 2 weeks ago
1
2 export const Leaderboard = {
3 /**
4 * Build and post/edit the leaderboard for the current week.
5 * Called after each score submission and on weekly reset.
6 */
7 async update({ weekKey }: { weekKey?: string } = {}): Promise<void> {
8 const client = DiscordClient.get();
9 const channelId = Config.get({ section: "channels", key: "leaderboard" });
10 if (!channelId) { log.warn("leaderboard channel not configured"); return; }

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 2 weeks ago
1 tg-bot-ts-dev | 17:15:02.979 🔹 [System: Result] INFO: char.class: WI char.name: «Keira»
2 tg-bot-ts-dev | [System: Result] [DEBUG] char.class: WI char.name: «Keira»
3 tg-bot-ts-dev | Interaction error: TypeError: Cannot read properties of undefined (reading 'toLowerCase')
4 tg-bot-ts-dev | at Object.class (/app/src/systems/emojis.ts:71:26)
5 tg-bot-ts-dev | at formatResultRow (/app/src/systems/result.ts:54:33)
6 tg-bot-ts-dev | at /app/src/systems/result.ts:102:29
7 tg-bot-ts-dev | at Array.map (<anonymous>)
8 tg-bot-ts-dev | at buildNationField (/app/src/systems/result.ts:102:18)
9 tg-bot-ts-dev | at buildResultEmbed (/app/src/systems/result.ts:130:18)
10 tg-bot-ts-dev | at Object.post (/app/src/systems/result.ts:218:20)

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 2 weeks ago
1 function buildRows(historyKey: TGKey): ResultRow[] {
2 const { slot, date } = TGKey.parse(historyKey);
3 let players: UserKey[] = Attendance.players(historyKey);
4 const rows: ResultRow[] = [];
5 const weekKey = WRank.weekKey(new Date(date));
6
7 // Fallback — read from history file directly
8 if (players.length === 0) {
9 const history = Store.read<{ scores: TGScore[] }>(TGKey.toHistoryPath(historyKey));
10 if (history?.scores) {

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 2 weeks ago
1 [Scheduler] Weekly reset scheduled: "0 0 * * 1" in Etc/GMT-2
2 [Scheduler] Registered: weekly-reset (0 0 * * 1)
3 (node:19) Warning: Supplying "ephemeral" for interaction response options is deprecated. Utilize flags instead.
4 (Use `node --trace-warnings ...` to show where the warning was created)
5 (node:19) Warning: Supplying "fetchReply" for interaction response options is deprecated. Utilize "withResponse" instead or fetch the response after using the method.
6 Interaction error: TypeError: Cannot read properties of undefined (reading 'toLowerCase')
7 at Object.class (/app/src/systems/emojis.ts:71:26)
8 at Object.char (/app/src/systems/format.ts:25:45)
9 at Object.performSwitch (/app/src/systems/character.ts:170:28)
10 at processTicksAndRejections (node:internal/process/task_queues:103:5)

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 2 weeks ago
1 async update({ weekKey }: { weekKey?: string } = {}): Promise<void> {
2 const client = DiscordClient.get();
3 const channelId = Config.get({ section: "channels", key: "leaderboard" });
4 if (!channelId) { log.warn("leaderboard channel not configured"); return; }
5
6 const week = weekKey ? WRank.weekFromKey(weekKey) : WRank.currentWeek();
7 const embed = buildLeaderboardEmbed();
8
9 if (!week) { log.warn(`Week ${weekKey} not found`); return; }
10

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 2 weeks ago
1 function buildRows(historyKey: TGKey): ResultRow[] {
2 const { slot } = TGKey.parse(historyKey);
3 let players: UserKey[] = Attendance.players(historyKey);
4 const rows: ResultRow[] = [];
5
6 // Fallback — read from history file directly
7 if (players.length === 0) {
8 const history = Store.read<{ scores: TGScore[] }>(TGKey.toHistoryPath(historyKey));
9 if (history?.scores) {
10 players = [...new Set(history.scores.map((s: TGScore) => s.userKey))];
Новее Позже

Работает на Opengist ⋅ Load: 110ms⋅

Русский
Čeština Deutsch English Español Français Magyar Italiano 日本語 Polski Português Русский Türkçe Українська 中文 繁體中文
⋅ KrilHub