Skip to content

Instantly share code, notes, and snippets.

View kirkegaard's full-sized avatar

Christian Kirkegaard kirkegaard

View GitHub Profile
@kirkegaard
kirkegaard / go-rle.go
Last active September 15, 2024 00:52
Go RLE encoder/decoder
package main
import (
"errors"
"fmt"
"strconv"
)
func rleEncode(input string) (string, error) {
if len(input) == 0 {
@kirkegaard
kirkegaard / go-grid.go
Last active September 3, 2024 20:44
one million checkboxes, except its only 625
package server
import (
"context"
"encoding/hex"
"fmt"
"github.com/go-redis/redis/v8"
"net/http"
"strconv"
"sync"
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>all your base is ket to ball</title>
<style>
* {
box-sizing: border-box;
margin: 0;
@kirkegaard
kirkegaard / go-irc-bot.go
Last active September 15, 2024 00:53
Irc bot written in go
package main
import (
"bufio"
"fmt"
"net"
"strings"
)
// Config holds the configuration for the IRC Client
@kirkegaard
kirkegaard / guess.js
Last active April 5, 2024 21:41
Name this decent modder. A guessing game in node
const readline = require('node:readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
const HIDDEN_CHAR = "_";
const words = [
[user]
name = Christian Kirkegaard
email = christian@lowpoly.dk
signingkey = /Users/christian/.ssh/id_rsa.pub
[github]
user = kirkegaard
[hub]
protocol = https
@kirkegaard
kirkegaard / scrollable.html
Created January 4, 2024 20:06
Horizontal scrollable container with fadeout
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<div class="container">
const canvas = document.querySelector('#canvas');
const ctx = canvas.getContext('2d');
let windowWidth = window.innerWidth;
let windowHeight = window.innerHeight;
const onResize = () => {
canvas.width = windowWidth = window.innerWidth;
canvas.height = windowHeight = window.innerHeight;
};
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Typeout</title>
<style>
body, html {
margin: 0;
padding: 0px;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script>
const endpoint = "https://api.covid19api.com/world/total";
const fetchData = async () => {