Skip to content

Instantly share code, notes, and snippets.

View foxt's full-sized avatar

foxt

View GitHub Profile
@foxt
foxt / lol.json
Last active December 16, 2019 13:58
{
"overrideTitle": false,
"overrideTitleContents": "firefox",
"overrideBodyContents": "lol bye, do your nea"
}
var apple = [9,10]
var position = [11,10]
var score = 0
var trail = []
var direction = 0
var movedThisFrame = false
var charset = {
head: "#",
tail: "~",
@foxt
foxt / is-devforum.lua
Created February 15, 2020 12:26
Detect if a user is on the Roblox devforum or not.
function getDevForumTrustLevel(username)
local succ,retval = pcall(function()
local apiResponse = game.HttpService:GetAsync("https://cors-anywhere.herokuapp.com/https://devforum.roblox.com/users/"..username..".json",false, {
["x-requested-with"] = "Roblox"
})
local j = game.HttpService:JSONDecode(apiResponse)
if (j["user"]) then
return j["user"]["trust_level"]
else
return -1
@foxt
foxt / sparky.js
Created February 28, 2020 12:34
Sparkline custom element
// Sparky v1.0
// theLMGN - https://github.com/thelmgn
// Example: <canvas is="spark-line" width="300" height="200" data="5,3,6,9,10,5" color="#52ACD4"></canvas>
class Sparky extends HTMLCanvasElement {
constructor() {
super();
var observer = new MutationObserver(function(mutations) {
try {
return this.render()
@foxt
foxt / scoresaber_buttons.user.js
Last active March 22, 2021 23:53
adds download buttons to ScoreSaber
// ==UserScript==
// @name Show BeatSaver key on ScoreSaber
// @namespace http://thelmgn.com/
// @version 0.3
// @description try to take over the world!
// @author theLMGN
// @match https://scoresaber.com/leaderboard/*
// @run-at document-end
// @downloadURL https://gist.githubusercontent.com/theLMGN/369eaee937dfe3b87a414b25faadfbe8/raw/scoresaber_buttons.user.js
// @updateURL https://gist.githubusercontent.com/theLMGN/369eaee937dfe3b87a414b25faadfbe8/raw/scoresaber_buttons.user.js
/** stolen from https://stackoverflow.com/a/48200842/4156215 **/
/**
* @description Options used when calling CanvasRenderingContext2D.strokeArcGradient() and
* CanvasRenderingContext2D.fillArcGradient().
* @property {Boolean} useDegrees Whether the specified angles should be interpreted as degrees rather than radians.
* (default: false)
* @property {Number} resolutionFactor The number of lines to render per pixel along the arc. A higher number produces
* a cleaner gradient, but has worse performance for large radii. Must be greater
* than 0. (default: 8)
@foxt
foxt / monaco_theme.json
Created July 3, 2020 01:39
Default Jellyfish Monaco theme.
{
"base": "vs-dark",
"inherit": true,
"colors": {
"editor.foreground": "#BFCAE0",
"editor.background": "#222222",
"editor.selectionBackground": "#3D4350",
"editor.lineHighlightBackground": "#4C576730",
"editorCursor.foreground": "#528BFF",
"editorWhitespace.foreground": "#747369"
/* Empty CSS file to help theme developers */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
body {
--accent: #CA1115;
--background: #202225;
--background-2: #222;
--background-3: #444;
--text: #fff;
--text-on-accent: #fff;
font-family: "Gotham SSm", "Montserrat", sans-serif;
<!DOCTYPE html><html lang=en><meta charset=UTF-8><meta content="width=device-width,initial-scale=1,user-scalable=no"name=viewport><title>Wordle - A daily word game</title><meta content="Guess the hidden word in 6 tries. A new puzzle is available each day."name=description><meta content=https://www.powerlanguage.co.uk/wordle/ property=og:url><meta content=website property=og:type><meta content="Wordle - A daily word game"property=og:title><meta content="Guess the hidden word in 6 tries. A new puzzle is available each day."property=og:description><meta content=https://www.dailywordle.com/images/wordle_og_1200x630.png property=og:image><meta content=summary_large_image name=twitter:card><meta content=powerlanguage.co.uk property=twitter:domain><meta content=#6aaa64 name=theme-color><link href=manifest.json rel=manifest><link href=images/wordle_logo_32x32.png rel="icon shortcut"sizes=3232><link href=images/wordle_logo_192x192.png rel=apple-touch-icon><style>:root{--green:#6aaa64;--darkendGreen:#538d4e;--yellow:#c
@foxt
foxt / pocketchip_usb.py
Created June 26, 2022 20:45
CircuitPython code for converting TCA8418 i2c keyboard matrix to USB
import time
import board
import busio
import usb_hid
import digitalio
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
KEY_MAP = {
1: Keycode.EQUALS,