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 dataModel = require("../models/dataModel"); | |
const { customAlphabet: genId } = require("nanoid"); // use nanoid@3.3.4 | |
const withoutCache = async () => { | |
const alphabet = "0123456789abcdefghijklmnopqrstuvwxyz"; | |
const id = genId(alphabet, 6)(); | |
const exists = await dataModel.findOne({ id }); | |
return exists ? await withoutCache() : 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
--- | |
name: Java CI with Gradle | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: |
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 http = require("http"); | |
const server = http.createServer(function (request, response) { | |
if (request.method == "POST") { | |
let body = ""; | |
request.on("data", function (data) { | |
body += data; | |
}); | |
request.on("end", function () { |
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
.theme-dark, | |
.theme-light, | |
:root { | |
--background-primary: #141414 !important; | |
--background-secondary: #111111 !important; | |
--background-secondary-alt: #292929 !important; | |
--background-tertiary: #0c0c0c !important; | |
--background-accent: #242424 !important; | |
--background-floating: black !important; | |
--background-modifier-hover: rgba(255, 255, 255, 0.01) !important; |
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 addStyles(styles) { | |
const css = document.createElement('style'); | |
css.type = 'text/css'; | |
if (css.styleSheet) css.styleSheet.cssText = styles; | |
else css.appendChild(document.createTextNode(styles)); | |
document.getElementsByTagName("head")[0].appendChild(css); | |
} | |
addStyles("the whole theme, note that it should be minified and shouldn't contain any @include") |