Skip to content

Instantly share code, notes, and snippets.

<!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.0" />
<title>Swiper</title>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css"
@bleeckerj
bleeckerj / CardRotation.tsx
Created June 9, 2024 03:40
Drag cards to scroll, click on a card to rotate it. Has perspective so its cool.
/* https://www.aceternity.com/components/card-rotation */
import { motion } from "framer-motion";
import {
HiCodeBracketSquare,
HiMagnifyingGlass,
HiMapPin,
HiTag,
HiWindow,
} from "react-icons/hi2";
import { useEffect, useRef, useState } from "react";
@bleeckerj
bleeckerj / markdown-to-email
Created January 29, 2024 17:18 — forked from rtulke/markdown-to-email
markdown-to-email A simple script to send beautifully formatted emails that you write in Markdown. The email will have an HTML payload and a plain-text alternative, so you'll make everyone happy, including yourself.
#!/usr/bin/env python
'''
Send an multipart email with HTML and plain text alternatives. The message
should be constructed as a plain-text file of the following format:
From: Your Name <your@email.com>
To: Recipient One <recipient@to.com>
Subject: Your subject line
---
@bleeckerj
bleeckerj / country.pug
Created December 27, 2022 05:31
Select options for Countries using PUG
label(for='country') Country:
select#propertyType.select.form-control.input-lg(form='addProperty', name='country')
option(value='Canada', selected= memberInfo.country == 'Canada') Canada
option(value='Germany',selected= memberInfo.country == 'Germany') Germany
option(value='France' ,selected= memberInfo.country == 'France') France
option(value='Switzerland', selected= memberInfo.country == 'Switzerland') Switzerland
option(value='United Kingdom', selected= memberInfo.country == 'United Kingdom') United Kingdom
option(value='United States', selected= memberInfo.country == 'United States') United States
option(value="Afghanistan", selected= memberInfo.country == 'Afghanistan') Afghanistan
option(value="Åland Islands", selected= memberInfo.country == 'Åland Islands') Åland Islands
ffmpeg -f concat -safe 0 -i concat.txt -c copy 1.wav
contact.txt:
file '/Users/julian/OMATA Dropbox/Julian Bleecker/NEAR FUTURE LABORATORY/Podcast/EPISODE TBD - PAULINA YURMAN/1-3.wav'
file '/Users/julian/OMATA Dropbox/Julian Bleecker/NEAR FUTURE LABORATORY/Podcast/EPISODE TBD - PAULINA YURMAN/1-4.wav'
ffmpeg -i 220803_002_0001.WAV -filter_complex 'channelsplit=channel_layout=4.0[C1][D2][C3][C4]' -map '[C1]' 1.wav -map '[D2]' 2.wav -map '[C3]' 3.wav -map '[C4]' 4.wav
@bleeckerj
bleeckerj / Github Webhook Tutorial.md
Created May 3, 2022 20:12 — forked from jagrosh/Github Webhook Tutorial.md
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings

Do not use forEach with async-await

TLDR: Use for...of instead of forEach in asynchronous code.

The problem

Array.prototype.forEach is not designed for asynchronous code. (It was not suitable for promises, and it is not suitable for async-await.)

For example, the following forEach loop might not do what it appears to do:

/**
_____ __ __________ _____
___ | / /__________ ________ ___ ____/___ ___ /____ _____________
__ |/ /_ _ \ __ `/_ ___/ __ /_ _ / / / __/ / / /_ ___/ _ \
_ /| / / __/ /_/ /_ / _ __/ / /_/ // /_ / /_/ /_ / / __/
/_/ |_/ \___/\__,_/ /_/ /_/ \__,_/ \__/ \__,_/ /_/ \___/
______ ______ _____
___ / ______ ___ /____________________ __ /__________________ __
__ / _ __ `/_ __ \ __ \_ ___/ __ `/ __/ __ \_ ___/_ / / /
_ /___/ /_/ /_ /_/ / /_/ / / / /_/ // /_ / /_/ / / _ /_/ /