Skip to content

Instantly share code, notes, and snippets.

View sicet7's full-sized avatar

Martin René Sørensen sicet7

View GitHub Profile
@sicet7
sicet7 / index.html
Last active February 7, 2024 12:41
[POC] Using SharedWorker in vanilla javascript to synchronize data between tabs/windows when polling an expensive computation
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>test</title>
</head>
<body>
<p id="data-output">Nothing</p>
<script type="text/javascript">
const DomUpdateWorker = {
@sicet7
sicet7 / configuration.nix
Last active May 4, 2024 23:55
My Nixos Configuration
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, lib, ... }:
let
home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/master.tar.gz";
dotnetPkg = pkgs.dotnetCorePackages.sdk_8_0;
in
@sicet7
sicet7 / jwk_with_phpseclib_test.php
Last active September 6, 2023 16:29
Use JWK from JSON with the lcobucci/jwt library through phpseclib. Credit to @whatTool for helping with the implementation
<?php
//REQUIREMENTS!
//"phpseclib/phpseclib": "^3.0"
//"lcobucci/jwt": "^5.0"
require_once __DIR__ . '/vendor/autoload.php';
$json = '{
"keys": [
{
@sicet7
sicet7 / main.go
Created March 6, 2023 12:13
String seeded random string generator in GO
package main
import (
"crypto/sha256"
"encoding/base64"
"encoding/binary"
"fmt"
"io"
"math/rand"
)
function Decode {
If ($args[0] -is [System.Array]) {
[System.Text.Encoding]::ASCII.GetString($args[0])
}
Else {
"Not Found"
}
}
#$test = Get-WmiObject WmiMonitorID -Namespace root\wmi
#$test
#!/bin/sh
echo "It now $(date +%d-%m-%Y_%H-%M)"
@sicet7
sicet7 / flameshot.sh
Last active January 29, 2021 18:13
Installs and configures flameshot for Ubuntu 20.04
#!/bin/sh
sudo apt install -y flameshot && \
gsettings set org.gnome.settings-daemon.plugins.media-keys screenshot '[]' && \
gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/flameshot/']" && \
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/flameshot/ name 'flameshot' && \
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/flameshot/ command '/usr/bin/flameshot gui' && \
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/flameshot/ binding 'Print'
@sicet7
sicet7 / commands.sh
Created January 25, 2021 07:17
Some useful cli commands
#!/bin/sh
watch "mutagen list | tail --lines=2 | head --lines=1"
docker stats --format="table {{.Name}}\t{{.CPUPerc}}\t{{.MemPerc}}\t{{.MemUsage}}\t{{.NetIO}}"
@sicet7
sicet7 / style.css
Created February 28, 2019 08:47
Cross browser disable text selection
element{
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
@sicet7
sicet7 / Dockerfile
Last active October 13, 2018 12:40
Runescape 3 Client Docker image WIP.
FROM nvidia/opengl:1.1-glvnd-runtime-ubuntu16.04
RUN apt update && \
apt install -y wget libsdl2-2.0-0 libc6 libcurl3-gnutls libstdc++6 libgcc1 libvorbisenc2 libwebkitgtk-1.0-0 libcurl3 libcanberra-gtk-module && \
apt install -y xdg-utils --fix-missing && \
wget http://gr.archive.ubuntu.com/ubuntu/pool/main/g/glew/libglew1.10_1.10.0-3_amd64.deb && dpkg -i libglew1.10_1.10.0-3_amd64.deb && rm libglew1.10_1.10.0-3_amd64.deb && \
wget http://content.runescape.com/downloads/ubuntu/pool/non-free/r/runescape-launcher/runescape-launcher_2.2.4_amd64.deb && dpkg -i runescape-launcher_2.2.4_amd64.deb && \
rm runescape-launcher_2.2.4_amd64.deb && apt clean
ENTRYPOINT ["/usr/bin/runescape-launcher"]