Skip to content

Instantly share code, notes, and snippets.

@eur2
eur2 / ffmpeg-web-video-guide.md
Created August 22, 2024 15:14 — forked from jaydenseric/ffmpeg-web-video-guide.md
A quick guide to using FFmpeg to create cross-device web videos.

Video conversion with FFmpeg

Install

On mac:

  1. Download the latest release.
  2. Extract the binary and place it in /usr/local/bin.

Command basics

@eur2
eur2 / Carousel.svelte
Last active February 28, 2024 16:56
siema wrapper svelte 5
@eur2
eur2 / clutter-free-vscode.jsonc
Created January 3, 2024 09:04 — forked from kamilogorek/_screenshot.md
Clutter-free VS Code Setup
// 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,
@eur2
eur2 / team.js
Created March 9, 2023 12:48 — forked from tmcw/team.js
// 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);
});
@eur2
eur2 / [slug].json.js
Created March 9, 2022 07:16
sveltekit-wp-api
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,
@eur2
eur2 / javascript-proxy-as-rest-client.js
Created February 9, 2022 08:16 — forked from DavidWells/javascript-proxy-as-rest-client.js
Using a javascript proxy as low code REST client
/* 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) {
@eur2
eur2 / image.ts
Created January 1, 2022 17:20 — forked from jacob-ebey/image.ts
Remix Image Component
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";
@eur2
eur2 / minesweeper.html
Created January 1, 2022 17:19 — forked from gaearon/minesweeper.html
minesweeper (incomplete/simplfied). stream: https://www.youtube.com/watch?v=CL01_m50TYY
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div id="canvas"></div>
<button id="restart">Restart</button>
<script src="minesweeper.js"></script>
<style>
* {
@eur2
eur2 / index.svelte
Created November 21, 2021 21:55
SvelteKit multiple select filter
<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>
@eur2
eur2 / localStorageStore.js
Created November 15, 2021 09:21 — forked from joshnuss/localStorageStore.js
LocalStorage store for Svelte.js. NPM Package: https://github.com/joshnuss/svelte-local-storage-store
/*
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