This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Youtube Shorts | |
www.youtube.com##ytd-guide-renderer a.yt-simple-endpoint path[d^="M10 14.65v-5.3L15 12l-5 2.65zm7.77-4.33"]:upward(ytd-guide-entry-renderer) | |
www.youtube.com##ytd-mini-guide-renderer a.yt-simple-endpoint path[d^="M10 14.65v-5.3L15 12l-5 2.65zm7.77-4.33"]:upward(ytd-mini-guide-entry-renderer) | |
www.youtube.com##ytd-browse[page-subtype="home"] .ytd-thumbnail[href^="/shorts/"]:upward(ytd-rich-item-renderer) | |
www.youtube.com##ytd-browse[page-subtype="subscriptions"] .ytd-thumbnail[href^="/shorts/"]:upward(ytd-grid-video-renderer,ytd-rich-item-renderer) | |
www.youtube.com##ytd-search .ytd-thumbnail[href^="/shorts/"]:upward(ytd-video-renderer) | |
www.youtube.com##ytd-browse[page-subtype="subscriptions"] ytd-video-renderer .ytd-thumbnail[href^="/shorts/"]:upward(ytd-item-section-renderer) | |
www.youtube.com##ytd-watch-next-secondary-results-renderer .ytd-thumbnail[href^="/shorts/"]:upward(ytd-compact-video-renderer,ytd-shelf-renderer) | |
www.youtube.com##ytd-browse[page-subtype="trending"] .ytd-thumbnail[href^="/sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function init_timeline(state) | |
tl_scenes={} | |
tl_state={ | |
time=0,duration=0, | |
seek_time=0,frame=0, | |
loop=true, | |
music_bpm=120.5, | |
music_sig=4, | |
music_idx=nil, | |
fixsync=true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
Debug function for Pico-8 | |
- Supports nested tables | |
- Colors output according to type | |
- Lists table values in alphanumeric key order | |
]] | |
function debug(val,x,y) | |
local oc=peek(0x5f25)--store original drawing color | |
local serialized=debug_serialize(val) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
Given a 1D-array of cells in a 2D-grid, | |
and a target cell with x and y coordinates, | |
it returns a table of neigboring cells. | |
Given a truthy third parameter, | |
it also returns diagonally adjacent cells. | |
]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
const OPPONENT = 1; | |
const RANDOM_OPPONENT = false; | |
module.exports = { | |
onTurn: function onTurn(turn) { | |
try { | |
const { gameState: state } = turn; | |
const { x, y, index, message } = makeMove(state); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Stage / CodeMirror Line wrapping | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1.2 | |
// @description Enables line wrapping for CodeMirror, with some responsive tweaks. | |
// @author Moses Holmström | |
// @match https://*.stage.crasman.fi/admin/* | |
// @match https://*.stage.crasman.cloud/admin/* | |
// @grant none | |
// @updateURL https://gist.github.com/thykka/53b1e602131a0c86a28bc62a116b9f18/raw/stage-codemirror-linewrap.user.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
Debug function for Pico-8 | |
- Serializes nested tables | |
- Colors output according to variable's type | |
- Lists table values in alphanumeric key order | |
]] | |
function debug(val,x,y) | |
local oc=peek(0x5f25)--store original drawing color | |
local serialized=debug_serialize(val) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// using for-loop structure to perform an action until a condition is satisfied | |
for( | |
// for-loop initialization: | |
// create a var which is a function that returns 0, 1 or 2, given an age | |
check = age => | |
// check for underage | |
age < 18 | |
? 0 | |
// check for oldness. what would a golfed loop be without a nested ternary? | |
: age < 66 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
line fonts v0.1 - thykka 2021 | |
==usage== | |
printl( | |
text, | |
x, y, | |
color, | |
font_size, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ Table helper functions -- | |
join(tbl) | |
shuffle(a) | |
sort(t, a, b) | |
t_filter(tbl, filter_fn) | |
t_find_i(tbl, find_fn) -- find_fn optional, defaults to matching equality with find_fn | |
t_find(tbl, find_fn) -- find_fn optional, -"- | |
t_flat(tbl) | |
t_map(tbl, map_fn) |
NewerOlder