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 / 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 / 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 / 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
@eur2
eur2 / httpStore.js
Created November 15, 2021 09:12 — forked from joshnuss/httpStore.js
A Svelte store backed by HTTP
import { writable } from 'svelte/store'
// returns a store with HTTP access functions for get, post, patch, delete
// anytime an HTTP request is made, the store is updated and all subscribers are notified.
export default function(initial) {
// create the underlying store
const store = writable(initial)
// define a request function that will do `fetch` and update store when request finishes
store.request = async (method, url, params=null) => {
@eur2
eur2 / checkForUndefinedCSSClasses.js
Created June 16, 2021 06:12 — forked from broofa/checkForUndefinedCSSClasses.js
ES module for detecting undefined CSS classes (uses mutation observer to monitor DOM changes). `console.warn()`s undefined classes.
/**
* Sets up a DOM MutationObserver that watches for elements using undefined CSS
* class names. Performance should be pretty good, but it's probably best to
* avoid using this in production.
*
* Usage:
*
* import cssCheck from './checkForUndefinedCSSClasses.js'
*
* // Call before DOM renders (e.g. in <HEAD> or prior to React.render())
@eur2
eur2 / cours1.md
Created March 11, 2021 08:48 — forked from tomsihap/cours1.md
Cours Wordpress : thèmes

Cours Wordpress

Exercice Quelle est la différence entre wordpress.com et wordpress.org ?

Exercice Téléchargez et installez Wordpress depuis https://wordpress.org/download/. Décompressez le fichier dans votre dossier de serveur (htdocs ou www) et suivez les instructions.

Attention à bien préciser le port de la base de données dans l'URL si celui-ci n'est pas 3306 : localhost:8889 par exemple.

Création d'un thème