Skip to content

Instantly share code, notes, and snippets.

View eviltester's full-sized avatar

Alan Richardson eviltester

View GitHub Profile
@eviltester
eviltester / gist:7beef92896fdd8b638656f996fac38c0
Last active September 28, 2023 15:12
Convert videos into subtitled sections using ffmpeg
# Create a new caption file
~~~~~~~~
ffmpeg -i captions.srt captions.ass
~~~~~~~~
# Add subtitles to main video without changing it
~~~~~~~~
ffmpeg -i video.mp4 -vf "subtitles=captions.ass:force_style='OutlineColour=&H80000000,BorderStyle=4,Outline=1,Shadow=0,MarginV=20'" subtitled-video.mp4
@eviltester
eviltester / gist:83ba5cb1e3f4b2766bb176b9b84449d5
Created August 17, 2018 12:38
compress mp4 with ffmpeg
ffmpeg -i original.mp4 -vcodec h264 -acodec aac compressed.mp4
@eviltester
eviltester / gist:c29f2add0fc713a5185261a3f11a00fc
Created August 16, 2018 06:00
find a bunch of stuff on the page and click on them
var divs = document.querySelectorAll('.button'); [].forEach.call(divs, function(div) { div.click();});
@eviltester
eviltester / gist:8405b63339acdf61a68bb8c128815c97
Created December 11, 2017 10:25
Delete Todo Items in the TodoMVC application
for (x = app.todos.models.length - 1; x >= 0; x--) {
app.todos.models[x].destroy()
}
@eviltester
eviltester / gist:f4b01d0b900cd4cbf64426f86c48a291
Created December 11, 2017 10:23
Create Data in TodoMVC BackBone app
for (x = 0; x < 100; x++) {
app.todos.create({
title: "todo ".concat(x),
order: app.todos.nextOrder(),
completed: false
})
}
var zTypeBotAlphaChars = "abcdefghijklmnopqrstuvwxyz";
var zTypeBotCharToType = 0;
ztypebot = setInterval(function() {
ig.game.shoot(
zTypeBotAlphaChars.charAt(zTypeBotCharToType));
zTypeBotCharToType = (zTypeBotCharToType +1)%26;
}
, 100);
@eviltester
eviltester / gist:65d6f47950699646c8e2cb0fe382b4fe
Last active August 16, 2017 09:21
run bookmarklet on http.cat to link page to httpstatuses.com
javascript:(function(){var%20cats=document.querySelectorAll(%22li.status%22);%20for%20(var%20i%20=%200,%20len%20=%20cats.length;%20i%20%3C%20len;%20i++)%20%7B%20cats%5Bi%5D.innerHTML%20+=%20%22%5Binfo%5D%22.link(%22https://httpstatuses.com/%22+cats%5Bi%5D.innerText);%20%7D})()