This file contains 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 { createApp, defineEventHandler, createError } from "h3"; | |
export const app = createApp({ | |
onError: () => console.error('Captured!'), | |
}); | |
app.use('/error', defineEventHandler(async () => { | |
throw createError({ | |
statusCode: 400, | |
}); |
This file contains 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
-- Simple mpv script to translate subtitle using crow (online) or sdcv (offline) dictionaries. | |
-- INSTALLATION: | |
-- To install it, first install crow (https://crow-translate.github.io) and/or sdcv (http://dushistov.github.io/sdcv/) on your marchine with your favorite dicts and then, | |
-- copy this file to '~/.config/mpv/scripts/' (Linux) or '%AppData%\mpv\scripts\' (Windows). | |
-- sdcv help: | |
-- you can download offline dicts from http://download.huzheng.org/Quick/ (or anywhere else) and copy extracted dic folder to '~/.stardict/dic/' | |
-- CONFIGURATION: | |
local config = { |
This file contains 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
line="================================================================================="; | |
printStuff="x | 1 2 3 4 5 6 7 8 9 "; | |
echo -e $printStuff; | |
echo $line; | |
i=1; | |
for (( i=1; i<10; i++ )) | |
do | |
printStuff="${i} | "; | |
for (( j=1; j<10; j++ )) | |
do |
This file contains 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 readline = require('readline'); | |
const process = require('process'); | |
module.exports.ask = (question) => new Promise((resolve) => { | |
const createdInterface = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout, | |
}); | |
createdInterface.question(`${question} `, (answer) => { | |
createdInterface.close(); |
This file contains 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 encoder(str, numericPass = 1234, decode = false) { | |
return str.split('').map(c => String.fromCharCode((c.charCodeAt(0) + ((decode ? -1 : 1) * numericPass)) % 256)).join('') | |
} |
This file contains 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
// Einstein's Five-House Riddle Solver | |
// Original question: https://udel.edu/~os/riddle.html | |
// by Nainemom <[email protected]> | |
const print = (colors, nations, drinks, pets, cigars, time) => { | |
console.log('') | |
console.log('-'.repeat(103)) | |
console.log(['#1', '#2', '#3', '#4', '#5'].join("\t\t\t")) | |
console.log('-'.repeat(103)) | |
console.log(colors.join("\t\t\t")) |