Skip to content

Instantly share code, notes, and snippets.

View kyranet's full-sized avatar
🏳️‍⚧️
Trans rights are human rights

Aura kyranet

🏳️‍⚧️
Trans rights are human rights
View GitHub Profile
@kyranet
kyranet / usage.md
Last active February 21, 2021 01:02
Skyra's Custom Commands

Argument Types:

  • {author.id}: Author's ID.
  • {author.name}: Author's name.
  • {author}: Mention of the author.
  • {server.acronym} / {guild.acronym}: The server's acronym.
  • {server.id} / {guild.id}: The server's ID.
  • {server} / {guild} / {server.name} / {guild.name}: The server's name.
  • {random {v1} {v2} {v3...}}: Shows one random value.
  • {channel.id}: Requests a channel, shows its ID.
  • {channel.name}: Requests a channel, shows its name.
yarn run v1.22.4
$ eslint --ext ts src test --debug
2020-05-25T17:02:59.553Z eslint:cli CLI args: [ '--ext', 'ts', 'src', 'test', '--debug' ]
2020-05-25T17:02:59.555Z eslint:cli Running on files
2020-05-25T17:02:59.564Z eslint:config-array-factory Loading JSON config file: D:\r\dirigeants\klasa\package.json
2020-05-25T17:02:59.566Z eslint:ignore-pattern Create with: [ IgnorePattern { patterns: [ '/node_modules/*', '/bower_components/*' ], basePath: 'D:\\r\\dirigeants\\klasa', loose: false } ]
2020-05-25T17:02:59.566Z eslint:ignore-pattern processed: { basePath: 'D:\\r\\dirigeants\\klasa', patterns: [ '/node_modules/*', '/bower_components/*' ] }
2020-05-25T17:02:59.567Z eslint:ignore-pattern Create with: [ IgnorePattern { patterns: [ '/node_modules/*', '/bower_components/*' ], basePath: 'D:\\r\\dirigeants\\klasa', loose: false } ]
2020-05-25T17:02:59.567Z eslint:ignore-pattern processed: { basePath: 'D:\\r\\dirigeants\\klasa', patterns: [ '/node_modules/*', '/bower_components/*' ] }
2020-05-25T17:02:59.568
{
"discord.detailsEditing": "Editing {filename}",
"discord.lowerDetailsEditing": "At: {currentline}:{currentcolumn}/{totallines} | Filesize: {filesize}",
"discord.smallImage": "VSCode",
"discord.workspaceElapsedTime": true,
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.fixAll.eslint": true,
"source.organizeImports": true
},
// The gist has been updated to be shortened to the shortest reproducible code,
// the old code is still available in this gist's history. However, the same bug
// is reproducible with this very small sample.
(() => {
async function test() {
console.log(new Error('Test 1'));
await Promise.resolve(null);
console.log(new Error('Test 2'));
}
SSE3=1 SSSE3=1 SSE4_1=1 SAHF=1 AVX=1 FMA3=1 BMI1=1 BMI2=1 LZCNT=1 POPCNT=1 ATOM=0
Synopsis:
shell [options] [--shell] [<file>...]
d8 [options] [-e <string>] [--shell] [[--module] <file>...]
-e execute a string in V8
--shell run an interactive JavaScript shell
--module execute a file as a JavaScript module
Options:
@kyranet
kyranet / rename-schema.bat
Created June 5, 2018 20:36
Scripts to rename the schema files for SGv2.2.0 (PR https://github.com/dirigeants/klasa/pull/320). Use wisely, this is a one-time run.
:: Batch script (Windows, cmd.exe)
:: You must download this file and run it in your cmd.exe, unlike the other two
:: scripts, this does not work in the command line.
@echo off
:: Capture all files that match _Schema.json and call the next function
for /f "delims=" %%a in ('dir /a:-d /o:n /b *_Schema.json') do call :next "%%a"
pause
@kyranet
kyranet / BigInt-Calc.cs
Created May 9, 2018 12:11
JS' BigInt vs C#'s BigInteger
using System;
using System.Numerics;
using System.Diagnostics;
namespace CSBenchmark
{
class Program
{
static void Main(string[] args)
{
const { Task } = require('../index');
const { util: { binaryToID } } = require('discord.js');
// THRESHOLD equals to 30 minutes in milliseconds:
// - 1000 milliseconds = 1 second
// - 60 seconds = 1 minute
// - 30 minutes
const THRESHOLD = 1000 * 60 * 30,
EPOCH = 1420070400000,
EMPTY = '0000100000000000000000';
const { Provider } = require('klasa');
const mysql = require('mysql2/promise');
const config = require('../config');
module.exports = class MySQL extends Provider {
constructor(...args) {
super(...args, {
enabled: true,
sql: true,