Skip to content

Instantly share code, notes, and snippets.

View emlyn's full-sized avatar

Emlyn Corrin emlyn

View GitHub Profile
@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 / 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 / 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
// ==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