Skip to content

Instantly share code, notes, and snippets.

View Malwine's full-sized avatar

Malwine Malwine

View GitHub Profile
@henrahmagix
henrahmagix / garlic-every-third-word.js
Last active December 28, 2018 20:42
Replace every 3rd word with "garlic"
// Select an element in the inspector, then paste this into the console.
function textNodesUnder(el){
var n, a=[], walk=document.createTreeWalker(el,NodeFilter.SHOW_TEXT,null,false);
while(n=walk.nextNode()) a.push(n);
return a;
}
function notAllWhitespace(value) {
return !value.match(/^\s*$/g);
;; Anything you type in here will be executed
;; immediately with the results shown on the
;; right.
(get {:a 0, :b 1} :c)
(get {:a 0, :b 1} :c "UNICORNS")
(get-in {:a 0 :b {:c "ho hum"}} [:b :c])
(if (> 5 3) "yes, it is" "no, it's not") ;; => "yes, it is"
(if (> 5 5) "yes, it is" "no, it's not") ;; => "no, it's not"
(if true
(do (println "Success!")
"1"
"2"
"3"
"4"

Emacs Lesson 1

Keybindings Cheatsheet

Getting out
C-x C-cExit emacssave-buffers-kill-terminal
C-gCancel running or partially typed commandkeyboard-quit
@jareware
jareware / README.md
Last active July 29, 2025 05:30
Conversion script between the TTML & SRT subtitle formats

premiere-subtitle-convert

Conversion script between the TTML & SRT subtitle formats. This is particularly useful with Adobe Premiere, as it doesn't understand the SRT format (which is joyously simple and interoperable). TTML-XML is probably the most straightforward subtitle format it does understand, hence this tool.

Note that due to the simplicity of the SRT format, this conversion is extremely lossy for all the bells and whistles supported by TTML. Not like you'd want fixed-pixel font sizes etc in your subtitles anyway, but you've been warned.