Skip to content

Instantly share code, notes, and snippets.

View joedevivo's full-sized avatar
💻
commands

Joe DeVivo joedevivo

💻
commands
View GitHub Profile
@jmatsushita
jmatsushita / README
Last active April 24, 2024 12:33
Setup nix, nix-darwin and home-manager from scratch on an M1 Macbook Pro
###
### [2023-06-19] UPDATE: Just tried to use my instructions again on a fresh install and it failed in a number of places.
###. Not sure if I'll update this gist (though I realise it seems to still have some traffic), but here's a list of
###. things to watch out for:
### - Check out the `nix-darwin` instructions, as they have changed.
### - There's a home manager gotcha https://github.com/nix-community/home-manager/issues/4026
###
# I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs).
# So here's a minimal Gist which worked for me as an install on a new M1 Pro.
@sindresorhus
sindresorhus / esm-package.md
Last active April 25, 2024 08:14
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.
@askpatrickw
askpatrickw / CircuitPython_Packages.MD
Last active January 11, 2022 09:54
Thoughts on Package Management for CircuitPython

Package Management for CircuitPython

Nothing formal written up on this yet, but I think we're seeing the download the zip file approach start to become brittle. Already there are two different bundles. My initial thought is why not have a cpip (or modify circup) and use PyPi. One thing I like about this is that it teaches new programmers things they need to learn if they also do Python programming. I've not done any real research into the technical parts of this yet, but in an ideal world, a fork of pip or some modular components of pip could be used to drive the core logic of version checking and install and the CP specific parts that deal with the board would be the

#!/usr/bin/awk -f
# This program is a copy of guff, a plot device. https://github.com/silentbicycle/guff
# My copy here is written in awk instead of C, has no compelling benefit.
# Public domain. @thingskatedid
# Run as awk -v x=xyz ... or env variables for stuff?
# Assumptions: the data is evenly spaced along the x-axis
# TODO: moving average
@sperand-io
sperand-io / worker.js
Last active October 28, 2023 09:41
Cloudflare Workers / Segment Smart Proxy — serve data collection assets and endpoints from your own domain
/**
* Steps to use:
* 1. Create CF Worker, copy and paste this in
* 2. (Optional) Update configuration defaults
* - If you want to manage in code, do so below under "Static Configuration"
* - If you want dynamic custom config: Create CFW KV namespace, link them, and add reference below
*
* - You can overwrite default path prefix for loading analytics.js (<yourdomain>/ajs)
* (corresponding KV entry: `script_path_prefix`)
* - You can overwrite default path prefix for handling first-party data collection (<yourdomain>/data)
@IanColdwater
IanColdwater / twittermute.txt
Last active April 22, 2024 17:26
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@yzl
yzl / TechAndEthicsReadingCollection.md
Last active October 5, 2020 22:13
tech and ethics reading collection

Tech and ethics reading collection

A list of books, essays, papers, blog posts, tweets, etc. on tech and ethics that I have either read and found useful or plan to read because I think they might be useful. I’m not especially interested in ethics that doesn’t take power or structure into account, so most of the standard texts one would read in a course on ethics aren’t represented on my list.

(My) starting point

Not strictly about either ethics or tech, but Claire Dederer’s What Do We Do With the Art of Monstrous Men? verbalizes something that is wound up in how I think about ethics, and what I hear when people talk about ethics:

This, I think, is what happens to so many of us when we consider the work of the monster geniuses—we tell ourselves we’re having ethical thoughts when really what we’re having is moral feelings.

Ideal theory

Dr. Robin James recommends Charles Mills’ [Ideal Theory as I

@charlesjohnson
charlesjohnson / Brewfile
Last active March 18, 2020 19:16
Brewfile
# Taps
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/cask-fonts"
tap "homebrew/core"
tap "sambadevi/powerlevel9k"
# Brew CLI apps
brew "fd"
brew "fzf"
@mbbx6spp
mbbx6spp / .00readme.org
Last active August 22, 2023 02:42
A caching and persistent Nix shell with direnv

Cached and Persistent Nix shell with direnv integration

Problem being solved

  • the default direnv Nix integration from projects loads a Nix shell every new terminal or every time shell.nix and/or default.nix changes. On larger projects with a lot of Nix shell dependencies, that can cause the terminal to take more than 6 seconds to load, which significantly degrades the developer experience (DX).
  • when a developer garbage collects in their Nix store, often the Nix shell dependencies are deleted also which causes a slow start the next time the project’s Nix shell is requested, also degrading developer experience (DX).

Solution outline

  • on first Nix shell load, the Nix shell is evaluated fully such that direnv dumps the environment from the spawn Nix shell process
@ejpcmac
ejpcmac / shell.nix
Last active February 12, 2024 18:03
Example shell.nix for Elixir projects using a preversion
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
let
elixir_1_7_0_rc_1 = { mkDerivation }:
mkDerivation rec {
version = "1.7.0-rc.1";
# Use `nix-prefetch-github --rev <version> elixir-lang elixir` to update.
sha256 = "1hp1zdscq7h2qcgcfbzw5dx1wxy05bqlrxvv5kcl8414c69inx8g";