Skip to content

Instantly share code, notes, and snippets.

View avidrucker's full-sized avatar

Avi Drucker avidrucker

  • SUNY Orange and SUNY WCC
  • New York
View GitHub Profile
@lmiller1990
lmiller1990 / promise.js
Created November 24, 2023 20:51
Improved Solution
import pdefer from "https://unpkg.com/p-defer@4.0.0/index.js";
/** @returns {Promise<Record<string, boolean>} */
async function fetchAllFeatures() {
console.log("Making network call...");
return new Promise((res, rej) => {
setTimeout(() => {
res({});
}, 500);
});
@wdhowe
wdhowe / simplicity.md
Created April 11, 2021 03:34
simplicity

Simplicity

Notes from Rich Hickey's Simplicity Matters slides.

"Simplicity is the ultimate sophistication." -Leonardo da Vinci

Toolkit

Complexity Simplicity
@Zekfad
Zekfad / conventional-commits.md
Last active December 7, 2025 18:30
Conventional Commits Cheatsheet

Quick examples

  • feat: new feature
  • fix(scope): bug in scope
  • feat!: breaking change / feat(scope)!: rework API
  • chore(deps): update dependencies

Commit types

  • build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
  • ci: Changes to CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
  • chore: Changes which doesn't change source code or tests e.g. changes to the build process, auxiliary tools, libraries
@yogthos
yogthos / clojure-beginner.md
Last active December 7, 2025 20:59
Clojure beginner resources

Introductory resources

@shaunlebron
shaunlebron / beautiful-printing.md
Last active November 16, 2021 00:38
Print beautiful articles (with HTML to LaTeX)

Print Beautiful Articles (with HTML to LaTeX)

It’s hard to read long articles on a computer. Printing them with beautiful typesetting helps.

This solution converts the whole article (or selected part) to LaTeX, then opens it for printing (or editing) in Overleaf. You need an account there, but no installs.

Images

Images are included in the LaTeX code, but won’t show up until you upload them individually to Overleaf. Look for the \includegraphics commands which are commented out in the code, and refer here for proper insertion.

#include <type_traits>
#include <iostream>
template <typename Id>
struct BoolTemplateType
{
using TypeId = Id;
};
template <typename T, typename... Args>
@cldwalker
cldwalker / knowledge-graph-experiment.md
Last active March 11, 2024 11:10
knowledge graph experiment

I like to learn, index and retrieve information a lot. I know a lot of others do as well. We share data but I don't think we share our information and rarely our ontologies (a.k.a. our mental models). If we shared our ontologies, I think we could learn more from each other. With this hope in mind, I'm looking for a tool that provides these features:

  • Shares my ontology publicly
  • Shares my bookmarks publicly
  • Provides easy entry, extension and querying of my ontology
  • Provides easy entry and querying of my bookmarks
  • Shares interesting snapshots of my bookmarks
  • Encourages discovery of information that is new and interesting to others

Since I have not found such a tool, I have built a tool that:

@gvolpe
gvolpe / di-in-fp.md
Last active September 16, 2024 07:18
Dependency Injection in Functional Programming

Dependency Injection in Functional Programming

There exist several DI frameworks / libraries in the Scala ecosystem. But the more functional code you write the more you'll realize there's no need to use any of them.

A few of the most claimed benefits are the following:

  • Dependency Injection.
  • Life cycle management.
  • Dependency graph rewriting.
@fomightez
fomightez / a_note_on LATEX notebook.md
Last active December 22, 2021 09:09
Latex Example Use in a Jupyter Notebook

Looks way better rendered at nbviewer than here.

Generating Procedural Game Worlds with Wave Function Collapse

Wave Function Collapse (WFC) by @exutumno is a new algorithm that can generate procedural patterns from a sample image. It's especially exciting for game designers, letting us draw our ideas instead of hand coding them. We'll take a look at the kinds of output WFC can produce and the meaning of the algorithm's parameters. Then we'll walk through setting up WFC in javascript and the Unity game engine.

sprites

The traditional approach to this sort of output is to hand code algorithms that generate features, and combine them to alter your game map. For example you could sprinkle some trees at random coordinates, draw roads with a brownian motion, and add rooms with a Binary Space Partition. This is powerful but time consuming, and your original vision can someti