Skip to content

Instantly share code, notes, and snippets.

View kirkegaard's full-sized avatar

Christian Kirkegaard kirkegaard

View GitHub Profile
@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 / client.go
Last active July 29, 2024 19:05
En Go Bot
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 = [
@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 () => {
@kirkegaard
kirkegaard / imgur.sh
Created December 30, 2020 02:58
Upload images to imgur from cli and save it in paste buffer
imgur() {
res=$(curl -sSF image=@$1 https://api.imgur.com/3/upload |jq -r '.data.link')
echo $res |pbcopy
echo $res
}
// Canvas things
const canvas = document.querySelector("#snow");
const ctx = canvas.getContext("2d");
let ctxLayers = [];
let ctxHeight = 0;
let ctxWidth = 0;
// FPS things
const FPS = 60;
const FPS_TIME = (1000 / 60) * (60 / FPS) - (1000 / 60) * 0.5;