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 { serve } from '@hono/node-server' | |
import { serveStatic } from '@hono/node-server/serve-static' | |
import { getCertificate } from '@vitejs/plugin-basic-ssl' | |
import { Hono } from 'hono' | |
import assert from 'node:assert' | |
import fs from 'node:fs/promises' | |
import { createServer } from 'node:https' | |
import path from 'node:path' | |
import { loadEnv } from 'vite' |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> |
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 fit ([wi, hi], [ws, hs]) { | |
const ri = wi / hi | |
const rs = ws / hs | |
return rs > ri ? [wi * hs / hi, hs] : [ws, hi * ws / wi] | |
} | |
// usage | |
const [width, height] = fit([16, 9], [2560, 1600]) |
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 toUpperCase (text) { | |
return Array.prototype.map.call(text, char => /[ა-ჰ]/.test(char) ? char : char.toUpperCase()).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
if(('orientation' in screen) && !player.settings.embeds.enabled) { | |
screen.orientation.addEventListener('change', function (e) { | |
if (screen.orientation.type === 'landscape-primary' || screen.orientation.type === 'landscape-secondary') { | |
player.fullscreen.enter(); | |
} else { | |
player.fullscreen.exit(); | |
} | |
e.preventDefault(); | |
e.stopPropagation(); | |
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#!/usr/bin/bash | |
proj="$(find ~/Projects/*.sublime-project -printf '%f\n' | awk 'match($0, /^(.+)\./, a) {print a[1]}' | fzf)" | |
if [ $proj ] | |
then | |
subl --project ~/Projects/$proj.sublime-project | |
fi | |
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 f(func){ | |
var func_str = func.toString(); | |
var params = func_str.match(/\((.+)\)/)[1].split(','); | |
var params_str = ''; | |
for(var key in params){ | |
var parsed_param = params[key].match(/(.+)(\/\*)(.+)(\*\/)/); | |
params_str += "var "+parsed_param[1]+"= (typeof "+parsed_param[1]+" == 'undefined' )?"+parsed_param[3]+":"+parsed_param[1]+";\n"; | |
} | |
func_str = func_str.replace(/\{/, '{\n\t' + params_str); | |
eval("var fun = "+func_str); |