Skip to content

Instantly share code, notes, and snippets.

View ff6347's full-sized avatar
🤖
updating status…

Fabian Morón Zirfas ff6347

🤖
updating status…
View GitHub Profile
const FRONT_KEYS = ['y', 'x', 'c', 'v', 'b', 'n', 'm', ','];
const BACK_KEYS = ['s', 'd', 'g', 'h', 'j'];
const frogs = document.querySelectorAll('.frog');
const frontFrogs = document.querySelectorAll('.frog.front');
const backFrogs = document.querySelectorAll('.frog.back');
frogs.forEach(frog => {
frog.addEventListener('click', () => playNote(frog));
@ff6347
ff6347 / index.html
Created June 24, 2022 11:04
toggle through elements
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>replit</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<style>
html, body {
@ff6347
ff6347 / esm-package.md
Created June 7, 2022 11:59 — forked from sindresorhus/esm-package.md
Pure ESM package

Pure ESM package

The package linked to from here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@ff6347
ff6347 / docker-compose.yml
Created May 31, 2022 08:57
simple inbucket setup with nodemailer
version: '3.4'
services:
mail:
image: inbucket/inbucket:latest
environment:
NODE_ENV: production
ports:
- 9000:9000
@ff6347
ff6347 / index.html
Created May 19, 2022 08:50
simple gist for p5js with hawk
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Starter</title>
<meta name="description" content="something" />
<meta name="author" content="me" />
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
echo "needs the gh github cli"
gh api /orgs/technologiestiftung/repos --paginate >tsb-repos.json
echo "you need to clean up the json manually. search for ][ and replace with ,"
sed -i '' s/\\]\\[/,/g ./tsb-repos.json
@ff6347
ff6347 / server.py
Created October 6, 2021 08:01 — forked from ljack/server.py
python 3 http server with tail file
from os import listdir,SEEK_END
from os.path import isfile, join, getmtime
from http.server import BaseHTTPRequestHandler, HTTPServer
import socketserver
import time
import subprocess
import select
from urllib.parse import parse_qs,urlparse
import logging
import sys, os, socket
@ff6347
ff6347 / webtail.py
Created October 5, 2021 14:12 — forked from scoffey/webtail.py
HTTP server that provides a web interface to run "tail" on a file, like the Unix command
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
HTTP server that provides a web interface to run "tail" on a file,
like the Unix command.
This is a standalone script. No external dependencies required.
How to invoke:
@ff6347
ff6347 / Setup headless Raspberry Pi.md
Last active September 15, 2021 05:29
Gist from Drafts

Setup headless Raspberry Pi

The whole process is basically:

  • Flash SD card with Raspberry OS Lite using the Raspberry imager
  • Create /ssh (empty file)
  • Create /wpa_supplicant.conf with wifi details
  • Put the SD card in the Pi and connect the power
  • ssh pi@rasperrypi.local (password raspberry) It takes < 10 min from unboxing a pi to being SSH’d into it.
//@ts-check
import got from "got";
import stream from "stream";
import zlib from "zlib";
import fs from "fs";
const fileList = ["file.gz", "file1.gz", "file2.gz", "file3.gz"];
const tmpFolderPath = "/tmp";
async function main() {
const transferTasks = fileList.map(