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
// current code | |
const arrs = [ | |
{ | |
comments: 'asd', | |
movement: 'Back Squat', | |
userID: 'wDHZv3OL55SIymHkhMUejNleNkx1', | |
weight: '330', | |
}, | |
{ |
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 { Composer, MiddlewareFn } from "telegraf" | |
import { logAction } from "app/core/helpers/logAction" | |
import { BotContext } from "types" | |
import { report } from "../helpers" | |
import { withoutKeys } from "app/core/helpers/misc" | |
import { Message } from "typegram" | |
// @see https://github.com/TGxTG/TOUGAO/blob/master/src/model/Message.js#L86 |
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
// ref https://flaviocopes.com/javascript-regular-expressions | |
const re=/(?<code>(c|g)_\w+)(.)(?<to>to)(.)(?<id>id\d+)/ | |
console.log(re.exec("c_84www to id890890")) // returns ["c_84www to id890890", "c_84www", "c", " ", "to", " ", "id890890", index: 0, input: "c_84www to id890890", groups: {code: "c_84www", to: "to", id: "id890890"}] |
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 { Context, Telegraf } from 'telegraf' | |
import { PrismaClient } from '@prisma/client' | |
import { session } from 'utils/telegraf-session-prisma' // path to session module | |
const prisma = new PrismaClient() | |
interface SessionData { | |
messageCount: number | |
// ... more session data go here |
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 { parameterize } from "inflected" | |
import { nanoid } from "nanoid" | |
export function toSlug(slug: string) { | |
slug = parameterize(slug) | |
const nano = nanoid(4) | |
// https://stackoverflow.com/a/16577007/3342703 | |
const id = nano.toLowerCase().replace(/[-_]/g, "") | |
return `${slug.replace("_", "")}-${id}` | |
} |
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
/** | |
* This is custom pagination helper that | |
* works with prisma 2 | |
* @author @_waptik | |
*/ | |
import db from "db" // xutom prisma wrapper by blitz-js | |
interface Paginate { | |
name: string |
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
openapi: 3.0.0 | |
info: | |
description: "This is a sample server Petstore server. You can find out more about | |
Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, | |
#swagger](http://swagger.io/irc/). For this sample, you can use the api key | |
`special-key` to test the authorization filters." | |
version: 1.0.2 | |
title: Swagger Petstore | |
termsOfService: http://swagger.io/terms/ | |
contact: |
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
// This file was initially generated by Windows Terminal 1.5.10411.0 | |
// It should still be usable in newer versions, but newer versions might have additional | |
// settings, help text, or changes that you will not see unless you clear this file | |
// and let us generate a new one for you. | |
// To view the default settings, hold "alt" while clicking on the "Settings" button. | |
// For documentation on these settings, see: https://aka.ms/terminal-documentation | |
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", | |
"defaultProfile": "{86b16bac-aa37-46bd-936f-1416225becc5}", | |
// You can add more global application settings here. |
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
;= @echo off | |
;= rem Call DOSKEY and use this file as the macrofile | |
;= %SystemRoot%\system32\doskey /listsize=1000 /macrofile=%0% | |
;= rem In batch mode, jump to the end of the file | |
;= goto:eof | |
;= Add aliases below here | |
e.=explorer . | |
gl=git log --oneline --all --graph --decorate $* | |
ls=ls --show-control-chars -F --color $* | |
pwd=cd |
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
{ | |
... | |
"terminal.integrated.env.windows": { | |
"CMDER_ROOT": "C:\\laragon\\bin\\cmder" | |
}, | |
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\cmd.exe", | |
"terminal.integrated.shellArgs.windows": [ | |
"/K", | |
"%CMDER_ROOT%\\vendor\\bin\\vscode_init.cmd" | |
], |