Skip to content

Instantly share code, notes, and snippets.

@vyznev
vyznev / incremental-markdown-preview.user.js
Last active July 10, 2018 10:10
Incremental Markdown preview for Stack Exchange
// ==UserScript==
// @name Incremental Markdown Preview for Stack Exchange
// @namespace https://github.com/vyznev/
// @description Speeds up the live Markdown preview on Stack Exchange sites by only updating changed DOM nodes
// @author Ilmari Karonen
// @version 0.1.0
// @copyright 2017-2018, Ilmari Karonen
// @license ISC; https://opensource.org/licenses/ISC
// @match *://*.stackexchange.com/*
// @match *://*.stackoverflow.com/*
@vyznev
vyznev / apgdecode.py
Last active February 4, 2019 01:04
Golly script for loading apgcodes as patterns
#! /usr/bin/python
# apgdecode.py v0.2
# A script for loading apgcodes (http://conwaylife.com/wiki/Apgcode) as Golly (http://golly.sourceforge.net/) patterns.
# Supports extended and multistate apgcodes. (Multistate handling may still have bugs. Let me know if you find any.)
# Copyright 2019 Ilmari Karonen. Released under the WTFPL (http://www.wtfpl.net/).
import golly as g
import re
@vyznev
vyznev / make_lls_grid.py
Last active August 9, 2019 08:39
Generate Logic Life Search (LLS) input grid for finding spaceships and oscillators, with additional features not yet supported natively by LSS (like strobing background and gradually moving search area).
#!/usr/bin/python
import re
import sys
import argparse
def fail(msg):
sys.stderr.write(sys.argv[0] + ": " + msg + "\n")
sys.exit(1)
@vyznev
vyznev / hex2map.py
Last active July 28, 2020 12:01
Convert non-totalistic hexagonal CA rules to MAP rules
#!/usr/bin/python
"""
This script converts hexagonal isotropic (possibly non-totalistic) CA rules[1]
into the equivalent MAP rules[2]. It runs under both Python 2 and Python 3, and
can be used either as a stand-along script (with the rules given as command line
arguments) or as a Golly plug-in.
[1]: http://www.conwaylife.com/wiki/Isotropic_non-totalistic_Life-like_cellular_automaton#Hexagonal_neighbourhood
[2]: http://golly.sourceforge.net/Help/Algorithms/QuickLife.html
"""
@vyznev
vyznev / throttle_steering.ks
Created September 2, 2020 12:40
kOS script for differential throttle augmented steering
// This script sets up a background trigger that automatically adjusts engine throttle according to the yaw / pitch / roll
// commands of the kOS built-in steering manager. This can allow a vessel to be controlled even without any reaction wheels,
// gimbals or control surfaces, and can also provide additional control authority and stability on top of normal steering
// especially for vessels with asymmetric thrust.
//
// The operation of the trigger is controlled by a number of global variables:
//
// * Setting dt_flag to false will terminate the trigger loop.
// * The loop will adjust throttle on any engines listed in dt_engines (by default, all engines on the vessel).
// * The baseline thrust limit on all controlled engines, in the absence of steering input, is set to dt_base percent.
@vyznev
vyznev / etcsl_charenc_fix.user.js
Last active March 31, 2021 22:08
The ETCSL website sometimes loses track of the selected encoding. This script fixes it and makes switching between Unicode and ASCII easy.
// ==UserScript==
// @name ETCSL charenc fix
// @namespace https://github.com/vyznev/
// @description The ETCSL website sometimes loses track of the selected encoding. This script fixes it and makes switching between Unicode and ASCII easy.
// @author Ilmari Karonen
// @version 1.1
// @match *://etcsl.orinst.ox.ac.uk/*
// @homepageURL https://gist.github.com/vyznev/b078af6b3574f80879f93675f59d8c86
// @downloadURL https://gist.github.com/vyznev/b078af6b3574f80879f93675f59d8c86/raw/etcsl_charenc_fix.user.js
// @run-at document-start
@vyznev
vyznev / se-bounty-bar.user.js
Last active April 11, 2021 13:33
Stack Exchange Bounty Bar user script (prototype)
// ==UserScript==
// @name Stack Exchange Bounty Bar
// @namespace https://github.com/vyznev/
// @description Shows a randomized selection of bountied questions in the Stack Exchange sidebar
// @author Ilmari Karonen
// @version 0.0.19
// @copyright 2018, Ilmari Karonen
// @license ISC; https://opensource.org/licenses/ISC
// @match *://*.stackexchange.com/*
// @match *://*.stackoverflow.com/*
@vyznev
vyznev / codegolf_sorter.user.js
Created May 30, 2014 23:46
User script to add sort answers by code length on Code Golf Stack Exchange
// ==UserScript==
// @name Code Golf SE sorter
// @namespace http://vyznev.net/
// @version 0.6
// @description Add a tab to sort answers by code length
// @match *://codegolf.stackexchange.com/questions/*
// @copyright 2014, Ilmari Karonen
// @grant none
// ==/UserScript==
@vyznev
vyznev / se-sticky-vote-buttons.user.js
Last active August 26, 2021 17:09
Enable sticky vote buttons on Stack Exchange sites
// ==UserScript==
// @name SE Sticky Vote Buttons
// @namespace https://github.com/vyznev/
// @description Enable sticky vote buttons on Stack Exchange sites
// @author Ilmari Karonen
// @version 0.6.0
// @copyright 2018-2021, Ilmari Karonen
// @downloadURL https://gist.github.com/vyznev/607e86f3890d920f67d7cbd6c5f78e7b/raw/se-sticky-vote-buttons.user.js
// @match *://*.stackexchange.com/*
// @match *://*.stackoverflow.com/*
@vyznev
vyznev / disable_display_math_in_comments.user.js
Last active August 26, 2021 17:12
User script to disable MathJax display math in comments on Stack Exchange sites
// ==UserScript==
// @name Disable display math in comments
// @namespace https://github.com/vyznev/
// @description Forces all MathJax elements in comments to be rendered inline
// @author Ilmari Karonen
// @version 1.1
// @match *://*.stackexchange.com/*
// @match *://*.mathoverflow.net/*
// @homepageURL http://meta.math.stackexchange.com/questions/23250/disable-display-math-in-comments
// @grant none