On mac:
- Download the latest release.
- Extract the binary and place it in
/usr/local/bin.
On mac:
/usr/local/bin.| <!-- <svelte:options runes={true} /> --> | |
| <script> | |
| // import Siema from 'siema'; | |
| // import * as Siema from 'siema'; | |
| // import { onMount, createEventDispatcher } from "svelte"; | |
| import Siema from "$lib/siema"; | |
| let { | |
| onchange, |
| // Required Plugin: https://marketplace.visualstudio.com/items?itemName=drcika.apc-extension | |
| // settings.json | |
| { | |
| // Remove left-side icons | |
| "workbench.activityBar.location": "hidden", | |
| // Remove bottom status bar | |
| "workbench.statusBar.visible": false, | |
| // Remove position indicator in the editor's scrollbar | |
| "editor.hideCursorInOverviewRuler": true, |
| // using reduce | |
| var team = posts.team.reduce(function(prev, post, index, list) { | |
| prev.push(post.metadata.title); | |
| return prev; | |
| }, []); | |
| // using map | |
| var team = posts.team.map(function(post) { | |
| return post.metadata.title); | |
| }); |
| import { BASE_URL, POSTS_API_URL } from "./api.js"; | |
| export const get = async (request) => { | |
| const slug = request.params.slug; | |
| const res = await fetch(`${BASE_URL}${POSTS_API_URL}?slug=${slug}&_embed`); | |
| const posts = await res.json(); | |
| const post = posts[0]; | |
| return { | |
| status: 200, |
| /* Using a JavaScript proxy for a super low code REST client */ | |
| // via https://dev.to/dipsaus9/javascript-lets-create-aproxy-19hg | |
| // also see https://towardsdatascience.com/why-to-use-javascript-proxy-5cdc69d943e3 | |
| // also see https://github.com/fastify/manifetch | |
| // also see https://github.com/flash-oss/allserver | |
| // and https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb | |
| const createApi = (url) => { | |
| return new Proxy({}, { | |
| get(target, key) { |
| import { createHash } from "crypto"; | |
| import fs from "fs"; | |
| import fsp from "fs/promises"; | |
| import path from "path"; | |
| import https from "https"; | |
| import { PassThrough } from "stream"; | |
| import type { Readable } from "stream"; | |
| import type { LoaderFunction } from "remix"; | |
| import sharp from "sharp"; | |
| import type { Request as NodeRequest } from "@remix-run/node"; |
| <!DOCTYPE html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| </head> | |
| <body> | |
| <div id="canvas"></div> | |
| <button id="restart">Restart</button> | |
| <script src="minesweeper.js"></script> | |
| <style> | |
| * { |
| <script context="module"> | |
| export async function load({ fetch }) { | |
| const res = await fetch('https://eurogroupe.org/dev/wp/wp-json/wp/v2/posts'); | |
| return { | |
| props: { | |
| posts: await res.json() | |
| } | |
| }; | |
| } | |
| </script> |
| /* | |
| It's now a package. You can find it here: | |
| https://github.com/joshnuss/svelte-local-storage-store | |
| */ | |
| // Svelte store backed by window.localStorage | |
| // Persists store's data locally |