Simple command to check the fuel level of the turtle.
wget https://gist.githubusercontent.com/ghostdevv/366cce6995906d6dce8b15ca13a8aad4/raw/8085d548d0ab634cc22dfc24bd98350989e4d9e6/fuel.lua
#!/bin/bash | |
set -e | |
echo Updating | |
sudo apt update | |
if ! command -v jq &> /dev/null; then | |
echo Installing jq | |
sudo apt-get install jq |
function flat<T extends any[], D extends number = 1>(array: T, depth?: D): FlatArray<T, D>[] { | |
return typeof depth == 'undefined' || depth > 0 | |
? array.reduce((a, x) => a.concat(Array.isArray(x) ? flat(x, (depth ?? 1) - 1) : x), []) | |
: array | |
} |
/** | |
* A simple theme for reveal.js presentations, similar | |
* to the default theme. The accent color is darkblue. | |
* | |
* This theme is Copyright (C) 2012 Owen Versteeg, https://github.com/StereotypicalApps. It is MIT licensed. | |
* reveal.js is Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se | |
*/ | |
@import url("https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500;600;700&display=swap"); | |
section.has-dark-background, section.has-dark-background h1, section.has-dark-background h2, section.has-dark-background h3, section.has-dark-background h4, section.has-dark-background h5, section.has-dark-background h6 { | |
color: #fff; |
{ | |
"compilerOptions": { | |
"allowJs": true, | |
"checkJs": true, | |
"noEmit": true, | |
"strict": true, | |
"target": "es2022", | |
"module": "node16", | |
"moduleResolution": "node16", // or bundler depending | |
"allowSyntheticDefaultImports": true |
Note
test
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
</head> | |
<body> | |
<script> | |
document.write(`<pre>${JSON.stringify({ width: window.innerWidth, height: window.innerHeight }, null, 2)}</pre>`) |
<script lang="ts"> | |
import { faGripLines } from '@fortawesome/free-solid-svg-icons'; | |
import Fa from 'svelte-fa'; | |
type List = $$Generic<Array<any>>; | |
export let list: List; | |
let hovering: number | null = null; |
export const actions = { | |
first: async ({ request }) => { | |
const data = Object.fromEntries(await request.formData()); | |
console.log('first', data); | |
return { | |
data, | |
step: 2 | |
}; | |
}, | |
second: async ({ request }) => { |
{const ender_chars='⏃⏚☊⎅⟒⎎☌⊑⟟⟊☍⌰⋔⋏⍜⌿☌⍀⌇⏁⎍⎐⍙⌖⊬⋉'.split('');const eng_to_ender=Object.fromEntries('abcdefghijklmnopqrstuvwxyz'.split('').map((c,i)=>[c,ender_chars[i]]));const ender_to_eng=Object.fromEntries(Object.entries(eng_to_ender).map((x)=>x.reverse()));const to_ender=(c)=>eng_to_ender[c]??c;const to_eng=(c)=>ender_to_eng[c]??c;const translate=(str,fn)=>str.split('').map(fn).join('');function run(){const elements=document.querySelectorAll('[id^=message-content]:not([data-ender-parsed=true])',);for(const element of elements){element.innerHTML=element.innerHTML.replace(new RegExp(`[${ender_chars.join('')} ,.!?\\-;']+`,'gi'),(match)=>{return ender_chars.some((c)=>match.includes(c))?`<span title="${translate(match,to_eng)}">${ match }</span>`:match},);element.dataset.enderParsed='true'}}setInterval(run,1000);const template=`<form id="ender-translation-form"><input id="ender-translaion" name="text" required /><button type="submit">Translate</button></form>`;const element=document.createElement('div');element.in |