Skip to content

Instantly share code, notes, and snippets.

View danrouse's full-sized avatar

Dan Rouse danrouse

View GitHub Profile
@danrouse
danrouse / ffxiv-anti-idle.ahk
Created December 18, 2021 00:09
FFXIV anti-idle AHK script
#NoEnv
#SingleInstance force
SendMode Input
CoordMode, ToolTip, Screen
InputBox, Delay, FFXIV Anti-Idle, Enter a number of seconds between anti-idle inputs:,,190,144,,,,,60
If ErrorLevel {
Exit
}
ToolTip, Anti-Idle OFF, 0, 0
#EXTM3U
#EXTINF:0,NTV News24
http://www.news24.jp/livestream/index.m3u8
#EXTINF:0,GSTV
https://gemstv.wide-stream.net/gemstv01/smil:gemstv01.smil/chunklist.m3u8
#EXTINF:0,NHK World Japan live
https://nhkworld.webcdn.stream.ne.jp/www11/nhkworld-tv/global/2003458/live.m3u8
#EXTINF:0,ウェザーニュース
http://movie.mcas.jp/mcas/wn1_2/master.m3u8
#EXTINF:0,WOWOWシネマ
@danrouse
danrouse / code-golf_save-youtube-screenshot.js
Created December 6, 2018 00:33
code golf - save a screenshot from youtube
// starting point
// when run, should save a jpeg screencap of current video,
// named 'youtube_$ID_$TITLE_$TIME.jpg'
function screenshot() {
const video = document.querySelector('video.html5-main-video');
const { clientWidth: width, clientHeight: height } = video;
const canvas = document.createElement('canvas');
document.body.appendChild(canvas);
canvas.width = width;
@danrouse
danrouse / .di-fm-completion.sh
Created July 16, 2018 14:09
di.fm auto completion
#!/bin/bash
function di_fm_channels() {
curl -s https://www.di.fm/channels 2>&1 | grep di.app.start | sed 's/\s*di.app.start(//; s/);\s*$//' | jq -r .channels[].key
}
if [ ! -f /tmp/di_fm_channels ]; then
di_fm_channels | tr '\n' ' ' > /tmp/di_fm_channels
fi
@danrouse
danrouse / gmail-compose-encoder.js
Created May 3, 2018 16:22
gmail `compose` query parameter encoder/decoder
const fullAlphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
const restrictedAlphabet = 'BCDFGHJKLMNPQRSTVWXZbcdfghjklmnpqrstvwxz';
const threadPrefix = 'thread-';
const messagePrefix = 'msg-';
const isWhitespace = str => /^[\s\xa0]*$/.test(str);
const isInvalidString = str => str ? (str.indexOf(threadPrefix) !== -1 || str.indexOf(messagePrefix) !== -1) : false;
const encode = function(str) {
if (isWhitespace(str)) return str;
@danrouse
danrouse / sleepSort.js
Created November 29, 2016 18:08
sleep sort
function sleepSort(arr) {
var output = [];
for (var i = 0; i < arr.length; i++) {
setTimeout(output.push.bind(output, arr[i]), arr[i] * 100);
}
return output;
}
function populateArray(n) {
var arr = [];
@danrouse
danrouse / gist:47e11c17b7b9840f49eb
Created June 7, 2015 03:12
blackmagic desktopvideo 10.4a17 patch for kernel 3.19-
/usr/src/blackmagic-10.4a17/blackmagic_core.c:
189c189
< ddev = blackmagic_find_device_by_minor(iminor(filp->f_dentry->d_inode));
---
> ddev = blackmagic_find_device_by_minor(iminor(filp->f_path.dentry->d_inode));
212c212
< ddev = blackmagic_find_device_by_minor(iminor(filp->f_dentry->d_inode));
---
> ddev = blackmagic_find_device_by_minor(iminor(filp->f_path.dentry->d_inode));
241c241
@danrouse
danrouse / type-scale.scss
Created January 28, 2015 02:11
Sass Type Scale
$font-scale: 1.333;
$font-base-size: 1em;
$font-size: $font-base-size;
@for $i from 6 through 1 {
h#{$i} {
font-size: $font-size;
}
$font-size: $font-size * $font-scale;
}
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<link rel="import" href="../core-animated-pages/core-animated-pages.html">
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html">
<link rel="import" href="../core-animated-pages/transitions/cross-fade.html">
<link rel="import" href="../core-animated-pages/transitions/slide-down.html">
<link rel="import" href="../core-animated-pages/transitions/slide-up.html">
<link rel="import" href="../core-animated-pages/transitions/tile-cascade.html">
<polymer-element name="my-element">
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-scroll-header-panel/core-scroll-header-panel.html">
<polymer-element name="my-element">
<template>
<style>
:host {