Skip to content

Instantly share code, notes, and snippets.

/* https://puzzling.stackexchange.com/questions/60942/biggest-army-on-a-chessboard
Reminder
Everybody knows that we can place 8 queens in a chessboard without threatening each other (see There). same reasonment can be made for knights, bishops, rooks and kings. Giving respectively 32 knights, 14 bishops, 8 rooks, and 16 kings.
Problem
If we assign to each type of piece a value invertly proportionnal of the number of this we can place. It means Knights = 1/32. Bishop = 1/14. Rook = 1/8. Queen =1/8 and King = 1/16.
What is the best sum value we can achieve mixing these pieces still with none able to take each other?*/
/*
@jared-hughes
jared-hughes / search_windows.md
Created September 5, 2019 06:31
Search through windows in GNOME.

I got tired of going through different windows to find the one I wanted, so I made this.

Let's say you have 10 different terminal windows open (please use tabs instead, but this is just an example). You remember that in the window you want to go to, you were in the cool-project directory. So you run this program (normally connected to a keybinding) and type in "cool-project". It then shows you the top few windows which match that name. If in this case your memory failed you and the window actually had the name "great-project" in it, there's no problem! This uses fuzzy matching, so it would probably show your desired window near the top. You can navigate with up/down arrow keys to reach your desired window, then press enter to raise and focus it. Success!

@jared-hughes
jared-hughes / DesmoSteps.user.js
Last active May 24, 2021 03:07
Step through transformations on a Desmos graph. Superseded by https://github.com/jason-woolf/DesmosPlayer.
// ==UserScript==
// @name DesmoSteps
// @namespace http://github.com/jared-hughes
// @version 0.2.0
// @description Step through transformations automatically on a Desmos graph
// @author Jared Hughes (fireflame241)
// @match https://www.desmos.com/calculator*
// @grant none
// @run-at document-idle
// ==/UserScript==
@jared-hughes
jared-hughes / DesmosDuplicateExpressionHotkey.user.js
Last active May 24, 2021 03:06
Desmos Duplicate Expression Hotkey. Now bundled into the extension https://github.com/DesModder/DesModder
// ==UserScript==
// @name Desmos Duplicate Expression Hotkey
// @namespace http://github.com/jared-hughes
// @version 0.1
// @author fireflame241
// @description Binds Ctrl+Q to duplicate the selected expression
// @grant none
// @match https://*.desmos.com/calculator*
// ==/UserScript==
@jared-hughes
jared-hughes / DesmosSimulationWarp.user.js
Last active March 27, 2021 21:38
Desmos Simulation Warp
// ==UserScript==
// @name Desmos Simulation Warp
// @namespace http://github.com/jared-hughes
// @version 0.1
// @author fireflame241
// @description Execute a simulation at warp speed
// @grant none
// @match https://*.desmos.com/calculator*
// ==/UserScript==
@jared-hughes
jared-hughes / desmos-godmode.user.js
Last active September 19, 2024 07:36
Desmos Godmode: Increases the limit for lists to 1 million elements (from 10_000), and raises the limit for "expressions nested too deeply" from 32k to 1 million
// ==UserScript==
// @name Desmos godmode with lists
// @namespace github.com/jared-hughes
// @match *://www.desmos.com/calculator*
// @description Increase the limits on list length and "nested too deeply" error
// @grant none
// @version 1.4
// @run-at document-start
// @author jared-hughes
// ==/UserScript==
@jared-hughes
jared-hughes / custom-function.user.js
Last active May 18, 2021 00:23
Custom function in Desmos, including custom autoOperatorNames. Warning: currently incompatible with other scripts that manipulate the worker, such as desmos god mode.
// ==UserScript==
// @name Custom Desmos Function
// @namespace github.com/jared-hughes
// @match *://www.desmos.com/calculator*
// @description Custom function in Desmos, including custom autoOperatorNames. Warning: currently incompatible with other scripts that manipulate the worker, such as desmos god mode.
// @grant none
// @version 0.1.1
// @run-at document-start
// @author fireflame241 (Jared Hughes)
// ==/UserScript==
@jared-hughes
jared-hughes / desmos-accurate-implicits.user.js
Last active May 18, 2021 00:23
Desmos more accurate implicits
// ==UserScript==
// @name More accurate implicits
// @namespace github.com/jared-hughes
// @match *://www.desmos.com/calculator*
// @description More accurate implicit functions in Desmos! Very slow if you crank it up high. Incompatible with other userscripts that change workers.
// @grant none
// @version 0.1.0
// @run-at document-start
// @author fireflame241 (Jared Hughes)
// ==/UserScript==
@jared-hughes
jared-hughes / docs-gray-background.user.js
Created May 1, 2021 21:43
Set a light gray background on Google Docs
// ==UserScript==
// @name Docs Gray Background
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Set a light gray background on Google Docs
// @author Jared Hughes
// @match https://docs.google.com/document/d/*
// @match https://docs.google.com/presentation/d/*
// @grant none
// ==/UserScript==
@jared-hughes
jared-hughes / !Desmos_Quadtree_Viewer.md
Last active August 5, 2021 05:08
Desmos Quadtree Viewer: Draw and color-code quadtree boundaries in Desmos
  • Reveals the mechanism of Bernard (see an explanation in the Desmos Discord for more details)
  • May be helpful in improving graph quality/performance
  • To install, click on the Raw button to the right of desmos-quadtree-viewer.user.js with the TamperMonkey extension installed
    • This is incompatible with DesModder, so use Quadtree Viewer and DesModder in different browsers/profiles, or temporarily disable DesModder to allow Quadtree Viewer.
  • Select an implicit equation to show its quadtree boundaries
  • Designed for single-branch implicits in mind (i.e. not plotted via list of graphs). Multiple branches work but are hard to understand
  • The graph must be visible for Desmos to plot it. If you just want to see the quadtree, set the graph line width to something small like 0.01 (and remember to select the expression or enable "show all")
  • Note that Desmos tries to avoid using the implicit plotter whenever pos