Skip to content

Instantly share code, notes, and snippets.

View ThomasR's full-sized avatar

Thomas Rosenau ThomasR

View GitHub Profile
@ThomasR
ThomasR / websocket-debugger.user.js
Last active September 17, 2020 15:54
A userscript that provides simple websocket inspection e.g. in for Firefox (works in Chrome too)
// ==UserScript==
// @name Websocket debugger
// @namespace thomas-rosenau.de
// @version 1
// @grant none
// @include *
// @run-at document-start
// ==/UserScript==
((main) => {
@ThomasR
ThomasR / copernicus.css
Created August 5, 2017 13:39
Copernicus Theorem visualized
html, body {
color: white;
background: #2581c4;
font-family: sans-serif;
}
body {
animation: fadeIn linear backwards .5s 1.5s;
}
svg {
position: fixed;
@ThomasR
ThomasR / PowerShell.xml
Created March 21, 2016 20:23
Syntax Highlighting for PowerShell scripts in IntelliJ IDEA
<filetype binary="false" description="PowerShell" name="PowerShell">
<highlighting>
<options>
<option name="LINE_COMMENT" value="#" />
<option name="COMMENT_START" value="&lt;#" />
<option name="COMMENT_END" value="#&gt;" />
<option name="HEX_PREFIX" value="" />
<option name="NUM_POSTFIXES" value="" />
<option name="HAS_BRACES" value="true" />
<option name="HAS_BRACKETS" value="true" />
'use strict';
var esprima = require('esprima');
var esmangle = require('esmangle');
var escodegen = require('escodegen');
module.exports = code => {
let ast = esprima.parse(code);
let optimized = esmangle.optimize(ast, null);
optimized = ast;
GIMP Palette
Name: Material Design
Columns: 14
#
239 235 233 brown 50
215 204 200 brown 100
188 170 164 brown 200
161 136 127 brown 300
141 110 99 brown 400
121 85 72 brown 500
@ThomasR
ThomasR / anchordetector.js
Created September 19, 2015 16:38
A bookmarklet that shows named anchors / element ids for easy holinking
javascript: void (function {
var guid = 'anchor_detector';
// save scroll pos
var hash = location.hash.replace(/^#/, '');
var yTop = null;
if (/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(hash)) {
var focusedElement = document.querySelector(`#${hash}, [name="${hash}"]`);
if (focusedElement) {
@ThomasR
ThomasR / qrcode-bookmarklet.js
Last active November 28, 2019 01:06
A bookmarklet that generates a QR Code of the current URL. Click to return to page content.
javascript: void (function (main) {
var script = document.createElement('script');
script.onload = main;
script.src = 'https://davidshimjs.github.io/qrcodejs/qrcode.min.js';
document.head.appendChild(script).parentNode.removeChild(script);
})(function () {
var size = 400;
var qr = new QRCode(document.body, {
text: location.href,
width: size,
# help for “get-help” cmdlet and “foo.ps1 -?” call, cf. https://technet.microsoft.com/en-us/library/dd819489.aspx
<#
.SYNOPSIS
A brief description of the function or script. This keyword can be used
only once in each topic.
.DESCRIPTION
A detailed description of the function or script. This keyword can be
used only once in each topic.
@ThomasR
ThomasR / greasemonkey.template.js
Last active December 9, 2015 15:16
A Greasemonkey script template that injects the main script into the global scope, thus escaping the sandbox.
// ==UserScript==
// @name %name%
// @namespace %namespace%
// @description %description%
// @include %include%
// @exclude %exclude%
// @version 1
// @noframes
// @grant none
// @run-at document-end