Skip to content

Instantly share code, notes, and snippets.

@shaunlebron
shaunlebron / linebreak.md
Last active May 22, 2022
Line breaks in markdown
View linebreak.md
Hello  (<-- two spaces)
World

Hello
World


@shaunlebron
shaunlebron / _README.md
Last active Mar 16, 2022
Direct3D9 Wrapper DLL
View _README.md

In response to a StackOverflow question:

Overlaying on a 3D fullscreen application

This is code to build a Direct3D wrapper DLL, intercepting all calls to Direct3D interface functions so that you can draw your own objects to display over the game. Just plop the DLL into the same folder as the game's executable, and it should load it as if it were the real d3d9.dll file. It still forwards all calls to the real one in system32, just allows stuff to happen in between. original stackoverflow answer

View a-world-split-apart.md
@shaunlebron
shaunlebron / angleLerp.js
Created Feb 5, 2014
The best way to interpolate 2D angles
View angleLerp.js
/*
2D Angle Interpolation (shortest distance)
Parameters:
a0 = start angle
a1 = end angle
t = interpolation factor (0.0=start, 1.0=end)
Benefits:
1. Angles do NOT need to be normalized.
@shaunlebron
shaunlebron / beautiful-printing.md
Last active Nov 16, 2021
Print beautiful articles (with HTML to LaTeX)
View beautiful-printing.md

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.

@shaunlebron
shaunlebron / realtalk.md
Last active Sep 1, 2021
why Dynamicland Realtalk isn't open source
View realtalk.md

Transcribed from an interview with Toby Schachman and Paula Te on The Afrofuturist Podcast:

There's this notion of the open-source movement. There are a lot of things
that we totally resonate with that because it's about understanding how your
technology works. We're totally 100% on board with that.

But then there are other issues with the open-source community, where it's
very internet-based and so open-source ends up benefitting this group of
people who have really strong access to internet and understand how to use
@shaunlebron
shaunlebron / SketchSystems.spec
Last active Aug 18, 2021
Super Mario 64 controls
View SketchSystems.spec
Super Mario 64 controls
Stationary
Standing
move -> Walking
z -> Crouching
a -> Jumping
b -> Punching
Crouching
z up -> Standing
@shaunlebron
shaunlebron / dark_sheets.css
Last active Jul 13, 2021
Google Sheets Dark Mode
View dark_sheets.css
/* invert the table, formula bar, cell editor, and navbar
and dim transparency to soften */
#waffle-grid-container,
#formula-bar-name-box-wrapper,
div[role="navigation"],
.cell-input.editable {
filter: invert();
opacity: 0.9;
}
@shaunlebron
shaunlebron / README.md
Created May 31, 2012
Iterating Combinations
View README.md

Iterating Combinations

If you're trying to iterate all combinations of k=5 on n=36, this is how you loop through them.

int k = 5;
int n = 36;
int count = 0;
for (int i1=1; i1 &lt;= n-k+1; i1++)
@shaunlebron
shaunlebron / intro.md
Last active Feb 25, 2021
PingThings and Mr. Plotter
View intro.md