Skip to content

Instantly share code, notes, and snippets.

View christianjuth's full-sized avatar
💻
Visit my GH profile for a quick tic tac toe break

Christian :) christianjuth

💻
Visit my GH profile for a quick tic tac toe break
View GitHub Profile
@christianjuth
christianjuth / 0-spec.md
Last active October 2, 2025 12:31
Lemmy/PieFed Content Filtering Spec
export const filterFile = {
  specVersion: "lemmy-filters/1.0",
  options: {
    normalize: "nfkc_casefold",
    stripDiacritics: true,
  },
  rules: [
    {
      name: "Any",
@christianjuth
christianjuth / hooks.ts
Last active November 16, 2021 04:45
React Hooks
function useMouseSpeed(updateInterval = 500) {
const lastUpdateRef = useRef(Date.now())
const prevPositionRef = useRef<MousePosition | null> (null)
const currentPositionRef = useRef<MousePosition | null> (null)
const [speed, setSpeed] = useState(0)
useEffect(() => {
function trackMouse({ pageX: x, pageY: y }: MouseEvent) {
x = x / window.innerWidth
y = y / window.innerHeight
@christianjuth
christianjuth / merge_sort.py
Created November 28, 2020 05:15
Merge Sort in Python
def sort(arr):
length = len(arr)
if length >= 2:
splitIndex = int(length / 2)
left = arr[0:splitIndex]
right = arr[splitIndex:length]
left = sort(left)
@christianjuth
christianjuth / index.html
Created February 6, 2017 04:47
Working Terminal
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Open+Sans|Roboto:900|Pacifico" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link rel='stylesheet' href='style.css'/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src='script.js'></script>
</head>
<body>
<html>
<head>
<title>Todo by Christian Juth</title>
<link href="https://fonts.googleapis.com/css?family=Open+Sans|Roboto:900" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link rel='stylesheet' href='style.css'/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src='script.js'></script>
</head>
<body>
# global vars
perfect_number = []
stop = 100 # will find up to this many perfect numbers
# (probably will crap out at about four
# perfect nubmers due to size of equation)
i = 0
until perfect_number.size >= stop
# set vars
i = i + 1
@christianjuth
christianjuth / .gitignore
Last active August 29, 2015 14:19
Monkeytalk .gitignore
.metadata
DETAIL-*
reports
screenshots