Skip to content

Instantly share code, notes, and snippets.

View yowainwright's full-sized avatar
👦
Dad life!

Jeff Wainwright yowainwright

👦
Dad life!
View GitHub Profile
@kfox
kfox / README.md
Last active December 4, 2023 11:08
TCP echo server for Node.js

TCP echo server for Node.js

Usage

  1. Make sure you have a modern-ish version of Node.js installed.
  2. Type npx https://gist.github.com/kfox/1280c2f0ee8324067dba15300e0f2fd3
  3. Connect to it from a client, e.g. netcat or similar: nc localhost 9000
@yowainwright
yowainwright / README.md
Last active January 25, 2024 09:23
Build your own Dependabot

Build Your Own Dependabot in 5 minutes

Scope: This project focuses purely on JavaScript and, sure, Typescript 😎 but the same patterns could be applied to other languages and/or systems.


Preface, AKA The Problem

Dependabot is great! Why did I learn how I could replace it?

@yowainwright
yowainwright / $README.md
Last active December 21, 2022 19:27
Run Intel Mac Terminal Commands On Your M1 Mac Like A Boss In 5 Minutes Or Less

Run Intel Mac Terminal Commands On Your M1 Mac Like A Boss In 5 Minutes Or Less

After using terminals (iTerm, Terminal, Kitty) with an M1 Mac without issue for over a year, I finally came upon an issue that I couldn’t solve without using Rosetta. Rosetta is Mac software to run Intel Mac terminal commands on an M1 Mac. My issue initially came from trying to use Pyenv to install and use different versions of Python across multiple projects. After installing Rosetta, I initially used it by adding a custom flag to commands like this arch -x86_64 . This worked for me but was really error prone, “Did I forget the flag? Did I add the flag in the correct place?”.


This document describes solving M1 Mac vs Intel Mac terminal command discrepancies by creating a copy of your terminal and setting it up to run Intel Mac terminal commands using Rosetta. Although the process of making a Rosetta termi

@getify
getify / 1.md
Last active March 2, 2023 21:24
In defense of using blocks to create localized scope for variables... (part 1 of 2)
@brianspiering
brianspiering / install_pyspark_on_m1_mac.md
Created February 24, 2022 20:58
Installation guide to pyspark on M1 Mac

Install Spark

Run all of these commands at the command line (not in a Jupyter Notebook). The command line will have more informative error messages and if we need complete additional steps, we'll get the messages.

Spark is a framework within the Scala programming language. Scala uses the JVM (Java Virtual Machine) so you'll need install Java.

If you use homebrew:

@sindresorhus
sindresorhus / esm-package.md
Last active April 19, 2024 10:56
Pure ESM package

Pure ESM package

The package that linked you 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.
@DiogoDoreto
DiogoDoreto / yarn-lock-check.js
Last active April 18, 2022 03:39
Log dependencies that are potentially duplicated in yarn.lock
const readline = require('readline');
const fs = require('fs');
const file = fs.createReadStream('yarn.lock');
const rl = readline.createInterface(file);
let lastPkg, lastVer, lastLine, currPkg, currVer, currLine;
const re = /^"?(@?[^@]+)/;
rl.on('line', (line) => {
@mircohacker
mircohacker / release.yaml
Created April 30, 2020 08:13
Push to Github Pages with Github Actions
name: Build and Deploy
on:
push:
branches:
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
@getify
getify / 1.js
Last active March 19, 2023 08:32
tag function for formatting console.log(..) statements
function logger(strings,...values) {
var str = "";
for (let i = 0; i < strings.length; i++) {
if (i > 0) {
if (values[i-1] && typeof values[i-1] == "object") {
if (values[i-1] instanceof Error) {
if (values[i-1].stack) {
str += values[i-1].stack;
continue;
}