Skip to content

Instantly share code, notes, and snippets.

View r15ch13's full-sized avatar
👷‍♂️

Richard Kuhnt r15ch13

👷‍♂️
View GitHub Profile
@r15ch13
r15ch13 / settings.json
Last active May 6, 2019 14:14
Custom JSON Level coloring for Night Owl (VSCode)
{
"editor.tokenColorCustomizations": {
"[Night Owl]": {
"textMateRules": [
{
"name": "JSON Key - Level 0",
"scope": [
"source.json meta.structure.dictionary.json support.type.property-name.json"
],
"settings": {
@r15ch13
r15ch13 / gist:e9cad908bdc29ff4573f7711df38b0c9
Created April 8, 2018 14:42 — forked from mharsch/gist:5188206
serve HLS (HTTP Live Streaming) content from node.js

HLS streaming from node

Provided that you already have a file or stream segmenter generating your .m3u8 playlist and .ts segment files (such as the ffmpeg 'hls' muxer), this little node server will serve up those files to an HLS compatible client (e.g. Safari). If you're using node for your streaming app already, this obviates the need to serve the HLS stream from a separate web server.

loosely based on https://gist.github.com/bnerd/2011232

// loosely based on https://gist.github.com/bnerd/2011232
// requires node.js >= v0.10.0
// assumes that HLS segmenter filename base is 'out'
// and that the HLS playlist and .ts files are in the current directory
@r15ch13
r15ch13 / userContent.css
Created March 28, 2018 20:00
Dark about:home and about:newtab for Firefox
/* Copy to %appdata%\Mozilla\Firefox\Profiles\<profile>\chrome */
@-moz-document url("about:newtab"), url("about:home")
{
body{
background: #252525 !important;
color: #ddd !important;
}
#search-wrapper,
@r15ch13
r15ch13 / Invoke-Async.ps1
Last active December 5, 2017 20:17
FLAC to MP3 Powershell Script
<#
.Synopsis
A means of running multiple instances of a cmdlet/function/scriptblock
.DESCRIPTION
This function allows you to provide a cmdlet, function or script block with a set of data to allow multithreading.
https://gallery.technet.microsoft.com/scriptcenter/Invoke-Async-Allows-you-to-83b0c9f0
.EXAMPLE
$sb = [scriptblock] {param($system) gwmi win32_operatingsystem -ComputerName $system | select csname,caption}
$servers = Get-Content servers.txt
$rtn = Invoke-Async -Set $server -SetParam system -ScriptBlock $sb
@r15ch13
r15ch13 / lazy-load-embedded-youtube-video.css
Last active November 10, 2017 20:34
Lazy Load Embedded YouTube Videos
.youtube {
background-color: #000;
margin-bottom: 30px;
position: relative;
padding-top: 56.25%;
overflow: hidden;
cursor: pointer;
}
.youtube img {
width: 100%;
@r15ch13
r15ch13 / mailgun-common.conf
Last active November 1, 2018 19:18
Fail2Ban Mailgun MTA Actions
# Fail2Ban configuration file
#
# Author: Richard Kuhnt
#
# Common settings for mailgun actions
# Users can override the defaults in mailgun-common.local
[INCLUDES]
after = mailgun-common.local
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<body>
<outline text="Fun" title="Fun">
<outline text="The Oatmeal - Comics, Quizzes, &amp; Stories" title="The Oatmeal - Comics, Quizzes, &amp; Stories" type="rss" xmlUrl="http://theoatmeal.com/feed/rss" htmlUrl="http://theoatmeal.com/"/>
<outline text="xkcd.com" title="xkcd.com" type="rss" xmlUrl="http://xkcd.com/rss.xml" htmlUrl="http://xkcd.com/"/>
<outline text="The Daily WTF" title="The Daily WTF" type="rss" xmlUrl="http://syndication.thedailywtf.com/TheDailyWtf" htmlUrl="http://thedailywtf.com/"/>
<outline text="PHD Comics" title="PHD Comics" type="rss" xmlUrl="http://www.phdcomics.com/gradfeed.php" htmlUrl="http://www.phdcomics.com"/>
<outline text="The Perry Bible Fellowship" title="The Perry Bible Fellowship" type="rss" xmlUrl="http://pbfcomics.com/feed/feed.xml" htmlUrl="http://www.google.com/reader/view/feed%2Fhttp%3A%2F%2Fpbfcomics.com%2Ffeed%2Ffeed.xml"/>
<outline text="Oglaf! -- Comics. Often dirty." title="Oglaf! -- Comics. Ofte
@r15ch13
r15ch13 / keybase.md
Created February 17, 2017 16:24
Keybase proof

Keybase proof

I hereby claim:

  • I am r15ch13 on github.
  • I am r15ch13 (https://keybase.io/r15ch13) on keybase.
  • I have a public key whose fingerprint is 09CB E54F A4BC 3DEA 5A50 7947 B60F 774C BE85 C190

To claim this, I am signing this object:

@r15ch13
r15ch13 / 0_reuse_code.js
Created January 19, 2017 21:24
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@r15ch13
r15ch13 / cursor-trails.js
Last active September 28, 2019 22:47
cursor trails on a blurred image
/* globals jQuery */
/**
* Based on https://codepen.io/chrisdoble/pen/WQLLVp
*/
(function ($) {
window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame
$.fn.blurredImage = function (options) {
if (!this.length > 0) {
return false