Skip to content

Instantly share code, notes, and snippets.

View jhaynie's full-sized avatar

Jeff Haynie jhaynie

View GitHub Profile
@mapehe
mapehe / immutability.md
Created December 6, 2021 11:12
Immutable data without a blockchain

Immutable data without a blockchain

A careful read of the Nakamoto paper reveals that the original purpose of the blockchain is extremely specialized: A completely decentralized consensus among unreliable actors. I'd like to highlight the often overlooked fact that this is exactly what the blockchain is suitable for. Any change in the conditions and you are probably doing extra work. Data immutability is a good example. Recently, especially in the mainstream media, data immutability has been presented as something that has been pioneered by blockchain technology, though it's easier to achieve similar

@frankwarwick
frankwarwick / free-email-provider-domains
Last active June 4, 2023 15:51
A list of more than 16,345 free email provider domains. Some of these are probably not around anymore. It's a combined list from around the web. Please add anything I have missed in the comments.
0.pl
0-00.usa.cc
001.igg.biz
0039.cf
0039.ga
0039.gq
0039.ml
007addict.com
00b2bcr51qv59xst2.cf
00b2bcr51qv59xst2.ga
import * as React from "react";
import { useMousePosition } from "~/hooks/useMousePosition";
/** Component to cover the area between the mouse cursor and the sub-menu, to allow moving cursor to lower parts of sub-menu without the sub-menu disappearing. */
export function MouseSafeArea(props: { parentRef: React.RefObject<HTMLDivElement> }) {
const { x = 0, y = 0, height: h = 0, width: w = 0 } = props.parentRef.current?.getBoundingClientRect() || {};
const [mouseX, mouseY] = useMousePosition();
const positions = { x, y, h, w, mouseX, mouseY };
return (
<div
@aleclarson
aleclarson / rollup-typescript.md
Last active May 6, 2024 19:37
The best Rollup config for TypeScript libraries

Features

🔥 Blazing fast builds
😇 CommonJS bundle
🌲 .mjs bundle
.d.ts bundle + type-checking
🧐 Source maps

Install

/**
* # prosemirror-changeset
* This is a helper module that can turn a sequence of document changes into a set of insertions and deletions, for example to display them in a change-tracking interface. Such a set can be built up incrementally, in order to do such change tracking in a halfway performant way during live editing.
* This code is licensed under an MIT licence.
* ## Programming interface
* Insertions and deletions are represented as ‘spans’—ranges in the document. The deleted spans refer to the original document, whereas the inserted ones point into the current document.
* It is possible to associate arbitrary data values with such spans, for example to track the user that made the change, the timestamp at which it was made, or the step data necessary to invert it again.
*
* Based on last [commit made Mar 12, 2019](https://github.com/ProseMirror/prosemirror-changeset/tree/11cb7b1fc05357c0bac5c444eab48748e4c8aa3b) */

Jest and the --changedSince flag in GitHub Actions

Recently, I've been working a lot more with GitHub Actions - both writing actions and creating CI pipelines for projects.

Last week I picked up a project I started a bit ago: the nodejs/examples repository.

Note: The examples repository is still in early stages. As such, there's still a bunch of WIP work we're doing - we've intentionally not talked a bunch publicly about it yet. That said, if you're interested in helping, feel free to reach out to me on Twitter or the OpenJS Slack ❤️

The goal of this repository is to be home to a bunch of distinct and well-tested examples of real-world Node.js that go beyond "hello, world!". This means there's hopefully going to be a boatload of distinct projects in there.

@harperreed
harperreed / how-to-buy-a-domain.md
Last active September 9, 2020 17:08
how-to-buy-a-domain.md

buying a domain name

From a long deleted comment: http://www.avc.com/a_vc/2011/04/finding-and-buying-a-domain-name.html#comment-193649096

Okay, Kids, Here We Go...

"What You Need To Know About Your Next Domain Name"

I highly respect what Fred has done, and continues to do, to help entrepreneurs and for that I'd like to "give back" myself... and I'm posting anonymously as I have nothing to gain in anyway by sharing this information...

@dberstein
dberstein / README.md
Last active November 12, 2023 09:01
Git commit hook that prepends message with Jira issue(s) found in branch name (PR branch) otherwise requires message contains at least one Jira issue

With this commit-msg git hook and your branch names have Jira reference(s), your commit messages will be automatically updated to include any missing reference(s) too.

Installation

Place contents of this gist's commit-msg file into your checkout's .git/hooks/commit-msg file and make it executable.

Bash

cd path/to/your/git/checkout \
&amp;&amp; install -vbm 755 &lt;(curl -s https://gist.githubusercontent.com/dberstein/dcc50e171163c3f6e0f23b2b5de5dd49/raw/5e5372ff22a872321ad1f5469a4d579c15ce498a/commit-msg) "$(git rev-parse --git-dir)/hooks/commit-msg"
@mikeatlas
mikeatlas / postgres_array.go
Created February 28, 2018 17:00 — forked from adharris/postgres_array.go
PostgreSQL demo of Array types using Golang
package main
import (
"database/sql"
"errors"
"fmt"
_ "github.com/bmizerany/pq"
"os"
"regexp"
"strings"
@savaki
savaki / main.go
Last active August 22, 2022 09:27
comparison of confluent-kafka-go vs sarama-cluster consumer performance
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"fmt"
"io/ioutil"
"log"
"os"