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 / style.css
Created November 14, 2017 08:00
Cross-browser test wrap fix
.element{
overflow-wrap: break-word;
white-space: pre-wrap;
white-space: -moz-pre-wrap;
white-space: -pre-wrap;
white-space: -o-pre-wrap;
word-wrap: break-word;
}
@sicet7
sicet7 / .gitconfig
Last active October 15, 2020 06:36
My Aliases in my .gitconfig
[user]
email = example@example.com
name = Your Name
[alias]
assume = update-index --assume-unchanged
unassume = update-index --no-assume-unchanged
assumed = "!git ls-files -v | grep ^h | cut -c 3-"
ours = "!f() { git checkout --ours $@ && git add $@; }; f"
theirs = "!f() { git checkout --theirs $@ && git add $@; }; f"
unstage = reset HEAD
@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"]
@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 / 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 / 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'
#!/bin/sh
echo "It now $(date +%d-%m-%Y_%H-%M)"
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
@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"
)
@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": [
{