Each day at our company, developers are required to document their activities, painstakingly jotting down their daily work and future plans. A monotonous chore that I just really dislike.
So now, there's a scribe for that :
| /// <summary> | |
| /// Represents a periodic cycle that executes a callback at regular intervals using PeriodicTimer. | |
| /// </summary> | |
| public sealed class Cycle : IAsyncDisposable | |
| { | |
| readonly Task cycleTask; | |
| readonly CancellationTokenSource cancellation; | |
| volatile bool disposed; | |
| Cycle(TimeSpan period, Action callback, TimeSpan? initialDelay, Action<Exception>? onError) |
| using System.ComponentModel; | |
| using System.Diagnostics; | |
| using System.Diagnostics.CodeAnalysis; | |
| using System.Runtime.CompilerServices; | |
| using System.Threading.Channels; | |
| /// <summary> | |
| /// Specifies relaxations for channel operation that can improve performance when adhered to. | |
| /// </summary> | |
| [Flags] |
Each day at our company, developers are required to document their activities, painstakingly jotting down their daily work and future plans. A monotonous chore that I just really dislike.
So now, there's a scribe for that :
| // This code looks for syntax like `{{youtube: https://www.youtube.com/watch?v=dQw4w9WgXcQ}}` | |
| // rather than a plain URL, but it should be simple enough to modify the regex. | |
| // Call this function on your raw markdown before your markdown processor (e.g. Marked, ReMark, etc) is run on it, | |
| // and then pass the output of this function to your markdown processor. | |
| function embedYoutubeVideos(md: string): string { | |
| const ytRegexGlobal = /{{youtube: ?([^{}]+)}}/g; | |
| const matches = md.matchAll(ytRegexGlobal); | |
| let output = md; |
| using Stateless; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| namespace WorkFlow { | |
| public class MyStateMachine<T, TTrigger> { | |
| private readonly static object locker = new object(); | |
| private readonly T _element; |
This is a very minimal bit of polyfill code for when you want to use some basic p5.js code you wrote, but not pay the performance cost associated with importing the whole kitchen sink.
It basically implements some of the sintactic sugar I use the most from p5.js but using the Canvas api, so that I have the p5 api but without all the magic I'm probably not using in this particular sketch.
| terraform { | |
| required_providers { | |
| digitalocean = { | |
| source = "digitalocean/digitalocean" | |
| } | |
| } | |
| } | |
| provider "digitalocean" { | |
| } |
HackerNews discussed this with many alternative solutions: https://news.ycombinator.com/item?id=24893615
I already have my own domain name: mydomain.com. I wanted to be able to run some webapps on my Raspberry Pi 4B running
perpetually at home in headless mode (just needs 5W power and wireless internet). I wanted to be able to access these apps from public Internet. Dynamic DNS wasn't an option because my ISP blocks all incoming traffic. ngrok would work but the free plan is too restrictive.
I bought a cheap 2GB RAM, 20GB disk VM + a 25GB volume on Hetzner for about 4 EUR/month. Hetzner gave me a static IP for it. I haven't purchased a floating IP yet.
After you copy a component from the Tailwind UI library and begin to adapt it from Vue JS to Alpine JS .. you may wonder what to do about the transitions. As I'm exploring this myself, I am documenting it for others in the same boat.
| const trimText = (input = '', maximumLength = 80) => { | |
| const exceedsMaximum = input.length >= maximumLength; | |
| return { | |
| exceedsMaximum, | |
| text: exceedsMaximum ? `${ input.substr(0, input.lastIndexOf(' ', maximumLength)) }...` : input, | |
| } | |
| }; | |
| export default trimText; |