Skip to content

Instantly share code, notes, and snippets.

Thomas Rosenau ThomasR

Block or report user

Report or block ThomasR

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ThomasR
ThomasR / websocket-debugger.user.js
Last active Apr 14, 2019
A userscript that provides simple websocket inspection e.g. in for Firefox (works in Chrome too)
View websocket-debugger.user.js
// ==UserScript==
// @name Websocket debugger
// @namespace thomas-rosenau.de
// @version 1
// @grant none
// @include *
// @run-at document-start
// ==/UserScript==
((main) => {
@ThomasR
ThomasR / copernicus.css
Created Aug 5, 2017
Copernicus Theorem visualized
View copernicus.css
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 Mar 21, 2016
Syntax Highlighting for PowerShell scripts in IntelliJ IDEA
View PowerShell.xml
<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" />
View esminify.js
'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;
View Material-Palette.gpl
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 Sep 19, 2015
A bookmarklet that shows named anchors / element ids for easy holinking
View anchordetector.js
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 Nov 28, 2019
A bookmarklet that generates a QR Code of the current URL. Click to return to page content.
View qrcode-bookmarklet.js
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,
View help.ps1
# 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 Dec 9, 2015
A Greasemonkey script template that injects the main script into the global scope, thus escaping the sandbox.
View greasemonkey.template.js
// ==UserScript==
// @name %name%
// @namespace %namespace%
// @description %description%
// @include %include%
// @exclude %exclude%
// @version 1
// @noframes
// @grant none
// @run-at document-end
You can’t perform that action at this time.