Skip to content

Instantly share code, notes, and snippets.

@doyousketch2
doyousketch2 / nssb_mapgen.lua
Last active March 9, 2022 00:50
mapgen function for nssb
schemepath = minetest .get_modpath('nssb') ..'/schems/'
function nssb_register_buildings(
build_name, -- name of schematic
rand, -- 1/rand is probability of spawning
required, -- required block to to spawn on
height, -- under this height, schematic can spawn
near, -- scan if this node is near
width2fill ) -- width of schematic, to fill dirt / ice under
@doyousketch2
doyousketch2 / opensearch.xml
Last active February 14, 2022 20:06
Add Firefox search for Online Etymology Dictionary
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<!-- Generated by http://www.7is7.com/software/firefox/opensearch.html -->
<ShortName>Online Etymology Dictionary</ShortName>
<Description>Online Etymology Dictionary Search</Description>
<Url type="text/html" method="get" template="https://www.etymonline.com/search?q={searchTerms}&amp;sourceid=opensearch"/>
<Image width="16" height="16" type="image/x-icon">https://www.etymonline.com/favicon.ico</Image>
<InputEncoding>UTF-8</InputEncoding>
<moz:SearchForm>https://www.etymonline.com/</moz:SearchForm>
<moz:UpdateUrl>https://www.etymonline.com/opensearch.xml</moz:UpdateUrl>
@doyousketch2
doyousketch2 / luacontroller_interrupt.lua
Created June 2, 2019 16:02
Use interrupt to create a delay in Minetest Luacontrollers
local delay = 1
if event.type == 'program' then
interrupt( delay, 'Once' )
interrupt( delay, 'Loop' )
end
if event.type == 'interrupt' then
if event.iid == 'Once' then
@doyousketch2
doyousketch2 / github.css
Created December 9, 2020 02:39
GitHub Stylus dim mode
@-moz-document domain("github.com") {
/* header */
main > div:first-of-type { background-color: #999 !important }
/* usually just side column, but sometimes full-page, such as wiki */
body { background-color: #bbb !important }
button[aria-label^="Edit the file"] { background-color: #ff9955 !important }
button[aria-label^="Delete the file"] { background-color: #ff3366 !important }
@doyousketch2
doyousketch2 / stackoverflow.css
Created November 14, 2020 17:01
Stylus CSS for StackOverflow
@-moz-document domain("stackoverflow.com") {
:root {
--pro: #258;
--con: #512;
}
div.user-info { background: #222 !important }
div.owner { background: #000 !important }
/* pros */
@doyousketch2
doyousketch2 / twitter.css
Last active September 30, 2020 21:12
Reduce Twitter clutter
@-moz-document domain("twitter.com") {
div[role='group'] > div:nth-child(4) { display: none !important }
div[role='group'] > div:nth-child(5) > div > div > img { background-color: rgb(0, 60, 90) !important }
a[aria-label="Home"] { display: none !important }
a[aria-label="Home (New unread Tweets)"] { display: none !important }
a[aria-label="Search and explore"] { display: none !important }
a[aria-label="Notifications"] { background-color: rgb(11, 22, 33) !important }
a[aria-label="Direct Messages"] { background-color: rgb(11, 22, 33) !important }
@doyousketch2
doyousketch2 / !Volume.md
Last active July 21, 2020 04:33
Python Volume control for Linux

View vol-up.py & vol-down.py scripts, or Download ZIP

OpenSource PythonVersions Git.io License

Normally, when you scroll up-and-down on the volume icon,
the volume jumps 5% every time. 😝

I've got a 600 watt 📻 Yamaha 6.1 surround system, with a 300 watt sub. 🔈
a 5% increase in volume from my :computer

@doyousketch2
doyousketch2 / mt_bots.lua
Last active May 29, 2020 21:31
Ignore Minetest IRC passthrough chat-bots in HexChat
-----------------------------------------------------------
-- @Doyousketch2 AGPL-3 Jun 21, 2019
-- https://www.gnu.org/licenses/agpl-3.0.en.html
-----------------------------------------------------------
-- header
local name = 'mt_bots.lua'
local version = '1.1'
local description = 'Ignore Minetest IRC Bots'
@doyousketch2
doyousketch2 / ignore_bots.py
Last active May 29, 2020 21:31
Ignore IRC bots in HexChat
##=========================================================
## @Doyousketch2 AGPL-3 Jun 21, 2019
## https://www.gnu.org/licenses/agpl-3.0.en.html
##=========================================================
## header
__module_name__ = 'Ignore Bots'
__module_version__ = '1.0'
__module_description__ = 'Ignore Bots in IRC'
@doyousketch2
doyousketch2 / keepalive.sh
Last active March 11, 2020 23:14
KeepAlive for Terminal session
#! /bin/bash
active=true
while $active
do
window_id=`xdotool search --title "Terminal"`
if [ $window_id ] ; then
xdotool windowactivate $window_id
xdotool type clear