Skip to content

Instantly share code, notes, and snippets.

View emlyn's full-sized avatar

Emlyn Corrin emlyn

View GitHub Profile
@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.js
Last active April 7, 2022 10:32
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.js
// @updateURL https://gist.github.com/emlyn/979b2820eaa74fea01b8ddc1351a0f60/raw/show_password.js
// @namespace https://gist.github.com/emlyn
// @version 0.3
// @author Emlyn Corrin
// @match http*://*/*
// @grant none
@emlyn
emlyn / ms_ssi.js
Last active April 30, 2024 17:28
I keep getting shown the "Stay signed in" page on Microsoft domains, even when I select "don't show this again" - this script will automatically click on "yes" for you every time the page comes up.
// ==UserScript==
// @name Stay signed in to MS
// @description Automatically click "yes" on the Microsoft "stay signed in" page that keeps appearing.
// @downloadURL https://gist.github.com/emlyn/2f0c9702bd83fe7d232ed58626c90ac7/raw/ms_ssi.js
// @updateURL https://gist.github.com/emlyn/2f0c9702bd83fe7d232ed58626c90ac7/raw/ms_ssi.js
// @namespace https://gist.github.com/emlyn/
// @version 0.5
// @author Emlyn Corrin
// @match https://login.microsoftonline.com/* https://login.live.com/*
// @icon https://c.s-microsoft.com/favicon.ico?v2
@emlyn
emlyn / dbws.js
Last active August 10, 2022 13:19
Tampermonkey: Display workspace name at top of Databricks page
// ==UserScript==
// @name Databricks Workspace
// @description Display workspace name at top of Databricks page
// @downloadURL https://gist.github.com/emlyn/169af82a09c2af8d79494f8d7e7d90b1/raw/dbws.js
// @updateURL https://gist.github.com/emlyn/169af82a09c2af8d79494f8d7e7d90b1/raw/dbws.js
// @namespace https://gist.github.com/emlyn
// @version 0.4
// @author Emlyn Corrin
// @match https://*.azuredatabricks.net/*
// @icon https://databricks.com/favicon.ico