Skip to content

Instantly share code, notes, and snippets.

View emlyn's full-sized avatar

Emlyn Corrin emlyn

View GitHub Profile
// ==UserScript==
// @name Don't F With Paste
// @description Stop idiots who think they're clever
// @downloadURL https://gist.github.com/emlyn/e8a626ad794d36eb0856655c32bcf955/raw/dontfwithpaste.user.js
// @updateURL https://gist.github.com/emlyn/e8a626ad794d36eb0856655c32bcf955/raw/dontfwithpaste.user.js
// @namespace https://gist.github.com/emlyn
// @version 0.2
// @author Emlyn Corrin
// @match http*://*/*
// @grant none
@emlyn
emlyn / wordextract.py
Created June 25, 2024 22:21
Extract all embedded images from an (XML-format) Word document
#!/usr/bin/env python3
# Exatrct all embedded images from a Word document in their full resolution.
# In Word: File, Save As, choose XML format
# Then run the resulting Word XML file through this script.
import sys
import base64
from xml.dom.minidom import parse
@emlyn
emlyn / b64zip.js
Created January 22, 2024 11:29
Decode base64 encoded gzipped string in Javascript
const decodePart = async function(data) {
const ds = new DecompressionStream("gzip");
const resp = await fetch(`data:application/octet-stream;base64,${data}`);
const blob = await resp.blob();
return new Response(blob.stream().pipeThrough(ds)).text();
}
const decodeLine = async function(line) {
const GzipCompressionMagicHeader = 'H4sI';
for (const part of line.split(',')) {
@emlyn
emlyn / notebook_control.js
Last active April 18, 2023 17:03
Synapse control
// ==UserScript==
// @name Notebook Control-Run
// @description Make Ctrl+Enter run the current notebook cell (without jumping to the next one) in Synapse and Azure ML
// @downloadURL https://gist.github.com/emlyn/0dccc7f1093e1c64758745e73c4befa4/raw/notebook_control.js
// @updateURL https://gist.github.com/emlyn/0dccc7f1093e1c64758745e73c4befa4/raw/notebook_control.js
// @namespace https://gist.github.com/emlyn
// @version 0.4
// @author Emlyn Corrin
// @match https://web.azuresynapse.net/*
// @match https://ml.azure.com/*
@emlyn
emlyn / README.md
Last active June 13, 2022 12:49
Sonic Pi Lissajous synth & Harmonograph figures

Sonic Pi Lissajous synth & Harmonograph figures

This gist contains a custom Sonic Pi synth for generating Lissajous figures, along with some Sonic Pi code to generate the figures in the post on in-thread

The source for the synthdef is in lisa.scsynth, with a compiled version available for download at lisa.scsyndef.

The Sonic Pi code is split into three parts, for the three figures in the post:

with_fx :reverb do
use_synth :piano
play:E5, amp: 0.7, sustain: 1, release: 3
sleep 0.20
piano_intro
end
with_fx :reverb do
in_thread(name: :piano) do
loop do

Let it be

- The Beatles

on Sonic Pi

A self-contained version of what I have in my sonic-pi-experiments repo. It uses my guitar helper, so here I've pasted it into the buffer so anyone can run it.

Here's a recording of it on Soundcloud.

Rule The World

- Take That

on Sonic Pi

A self-contained version of what I have in my sonic-pi-experiments repo. It uses my play-helper and lyrics helpers, so here I've pasted them into the buffer so anyone can run it.

Here's a recording of it on Soundcloud.

@emlyn
emlyn / show_password.user.js
Last active September 28, 2024 22:16
Show Passwords with double click
// ==UserScript==
// @name Show Passwords
// @description Double click on password fields to show password
// @downloadURL https://gist.github.com/emlyn/979b2820eaa74fea01b8ddc1351a0f60/raw/show_password.user.js
// @updateURL https://gist.github.com/emlyn/979b2820eaa74fea01b8ddc1351a0f60/raw/show_password.user.js
// @namespace https://gist.github.com/emlyn
// @version 0.3
// @author Emlyn Corrin
// @match http*://*/*
// @grant none