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
| async function withTimeout(fn, ms = 400) { | |
| return new Promise(async (resolve, reject) => { | |
| setTimeout(() => { | |
| reject(); | |
| }, ms); | |
| resolve(await fn()); | |
| }); | |
| } | |
| async function delay(ms = 0) { |
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 { Fragment } from "preact"; | |
| import { useState, useLayoutEffect } from "preact/hooks"; | |
| import { createPortal } from "preact/compat"; | |
| export default ({ children, into }) => { | |
| const [target, setTarget] = useState(null); | |
| useLayoutEffect(() => { | |
| setTarget(document.querySelector(into)); | |
| }, []); |
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
| #!/bin/bash | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| apt-transport-https \ | |
| ca-certificates \ | |
| curl \ | |
| gnupg-agent \ | |
| software-properties-common |
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 class="checkbox"> | |
| <input type="checkbox" v-model="proxy" :value="value"> | |
| </div> | |
| </template> | |
| <script> | |
| export default { | |
| model: { | |
| prop: "model" |
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
| ALTER TABLE "table" | |
| ADD CONSTRAINT "c_table_value_json_object" | |
| CHECK "value" IS NULL | |
| OR (JSON_TYPE("value") IS NOT NULL AND JSON_TYPE("value") = 'OBJECT'); |
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
| Get-AppxPackage *skype* | Remove-AppxPackage |
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
| #!/bin/bash | |
| sudo apt install nginx | |
| # mariadb | |
| # https://downloads.mariadb.org/mariadb/repositories/ | |
| sudo apt update | |
| sudo apt install mariadb-server | |
| # php |
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
| #ifndef _ITOA_H | |
| #define _ITOA_H | |
| #include <stdlib.h> | |
| char* itoa(int i) | |
| { | |
| if (i == 0) { | |
| return "0"; | |
| } |
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
| CREATE TABLE "dates" ( | |
| "id" int auto_increment primary key, | |
| "date" date not null, | |
| "day" int not null | |
| ); | |
| SET @i = DATE('2018-01-01'); | |
| DELIMITER // | |
| WHILE @i < '2025-01-01' DO |
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
| certbot certonly --server https://acme-v02.api.letsencrypt.org/directory --manual --preferred-challenges dns -d 'domain.com,www.domain.com' |