Skip to content

Instantly share code, notes, and snippets.

View espeon's full-sized avatar
:octocat:
octo cat

natalie espeon

:octocat:
octo cat
View GitHub Profile
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
;previous song
F13::
Send {Media_Prev}
return
version: '3.7'
services:
reverse-proxy:
# The official v2 Traefik docker image
image: traefik:v2.1.6
# Enables the web UI and tells Traefik to listen to docker
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--entrypoints.https.address=:443"
const express = require("express");
const fs = require("fs");
const app = express();
function isValidURL(string) {
var res = string.match(/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g);
return (res !== null && string.includes(".gif"))
};
app.get("/api/pika/", (req, res) => {
@espeon
espeon / cool.js
Created September 23, 2020 07:39
function onYouTubeIframeAPIReady(){var e=document.getElementById("youtube-audio"),t=document.createElement("img");t.setAttribute("id","youtube-icon"),t.style.cssText="cursor:pointer;cursor:hand",e.appendChild(t);var a=document.createElement("div");a.setAttribute("id","youtube-player"),e.appendChild(a);var o=function(e){var a=e?"b.png":"b.png";t.setAttribute("src","https://co.uk/"+a)};e.onclick=function(){r.getPlayerState()===YT.PlayerState.PLAYING||r.getPlayerState()===YT.PlayerState.BUFFERING?(r.pauseVideo(),o(!1)):(r.playVideo(),o(!0))};var r=new YT.Player("youtube-player",{height:"0",width:"0",videoId:e.dataset.video,playerVars:{autoplay:e.dataset.autoplay,loop:e.dataset.loop},events:{onReady:function(e){r.setPlaybackQuality("small"),o(r.getPlayerState()!==YT.PlayerState.CUED)},onStateChange:function(e){e.data===YT.PlayerState.ENDED&&o(!1)}}})}
"object"==typeof navigator&&function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Plyr",t):(e=e||self).Plyr=t()}(this,(function(){"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}function n(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function a(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function s(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?a(Object(i),!0).forEach((function(t){n(e,t,i[t])}
@espeon
espeon / index.html
Created October 16, 2020 07:48
XWKdbNM
<body>
<script src="https://cdn.jsdelivr.net/npm/hls.js"></script>
<script src="https://gist.githack.com/kanbaru/e049b1c99a27639f48146aeeb7acb70c/raw/a3c7b51b0dba1e09de20909a01768eb39c7b1cc6/plyr.min.js"></script>
<script src="./script.js"></script>
<div class="container">
<video controls crossorigin playsinline >
<source
type="application/x-mpegURL"
src="https://stream.mux.com/S5F00JLz00E9Is8lc9MICneE7sHoCmjuiaI01C6ssA9Xh4.m3u8"
@espeon
espeon / create-hls.md
Last active March 2, 2021 00:14 — forked from mrbar42/README.md
bash scripts to create VOD HLS stream with ffmpeg almighty (tested on Linux and OS X) (edited to separate audio/better video presets)

running:

bash create-vod-hls.sh beach.mkv

will produce:

    beach/
      |- playlist.m3u8
 |- 360p.m3u8
#!/bin/bash
# Note(Mike): Avoid using `command` like the plague, prefer $(command)
underline=$( tput smul )
nounderline=$( tput rmul )
bold=$( tput bold )
normal=$( tput sgr0 )
# Note(Mike): Not sure what these do...
# W="\e[0;39m"
@espeon
espeon / player.js
Last active October 28, 2022 15:41
(react) plyr wrapper, supports quality selection. example here: https://csb-hwgis.netlify.app/
import React, { useEffect, useRef } from "react";
import Plyr from "plyr";
import "plyr/dist/plyr.css";
import Hls from "hls.js";
import "./player.css";
export default function Player({ isLive = false, playbackURL }) {
const videoRef = useRef(null);
const playerRef = useRef(null);
// const previewSrc = `https://image.mux.com/${playbackId}/storyboard.png`;
@espeon
espeon / dropalt_miwa.json
Created June 28, 2021 01:00
my qmk config for my Drop Alt
{
"version": 1,
"notes": "",
"documentation": "\"This file is a QMK Configurator export. You can import this at <https://config.qmk.fm>. It can also be used directly with QMK's source code.\n\nTo setup your QMK environment check out the tutorial: <https://docs.qmk.fm/#/newbs>\n\nYou can convert this file to a keymap.c using this command: `qmk json2c {keymap}`\n\nYou can compile this keymap using this command: `qmk compile {keymap}`\"\n",
"keyboard": "massdrop/alt",
"keymap": "dropalt_miwa",
"layout": "LAYOUT_65_ansi_blocker",
"layers": [
[
"KC_ESC",