Skip to content

Instantly share code, notes, and snippets.

@alexglow
alexglow / 1-basic-arp-test
Last active January 30, 2023 05:54
sonic-pi-arpeggidata
# arpeggiate a given chord, over a given octave range
# easily change the root note & scale while it's running
# based on robin.newman, https://in-thread.sonic-pi.net/t/force-random-notes-into-a-scale-after-transposing/4493/2
notes = scale(:c3,:major,num_octaves: 3) # list of 22 notes
arp = [0,2,4,7,9,11,14,16,18,21] # note values for arpeggiation, 0-indexed
live_loop :test do
n=rand_i(10) # number of notes in "arp" list; pick one
puts n
@HelloWorld017
HelloWorld017 / twitch-capture.user.js
Last active September 17, 2022 05:58
Capture twitch streaming or download clip.
// ==UserScript==
// @name Twitch Capture Now
// @namespace https://gist.github.com/HelloWorld017/805c0551ade99654925062a6b46da7c9
// @version 1.0.2
// @description Capture twitch streaming
// @author Khinenw
// @match *://*.twitch.tv/*
// @grant none
// ==/UserScript==
@Decicus
Decicus / README.md
Last active April 26, 2024 10:26
A userscript for displaying the actual date & time (relative to local time) of when a Twitch clip was created.

Twitch clip datetime userscript

A userscript for displaying the actual date & time (relative to local time) of when a Twitch clip (and video) was created.

FYI: It only works on URLs that start with https://clips.twitch.tv/.
This script does not work with URLs that are on the Twitch "channel pages" (https://www.twitch.tv/CHANNEL_NAME_HERE/clip/...).
This has been added as of v0.5.0.

"Under the hood" the script uses Date.toLocaleString() to format the date. The format of the date & time may differ from the screenshots below.

@abachman
abachman / trellis-keyboard.py
Created November 7, 2018 02:08
CircuitPython Trellis M4 Keyboard Demo
# CircuitPython + Trellis M4 Keyboard emulator. Fits in your pocket!
# using https://www.adafruit.com/product/4020
#
# Should work on any PC
import time
import board
import digitalio
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS
@panzi
panzi / mediaspeed.md
Last active May 24, 2017 10:59
Change media speed.

Create a new bookmark and set the URL to the javascript:-URL of the speed you want. Click that link when you want to set a video's (or audio's) speed. In principle it works with Twitch VODs when using the HTML5 player, but Twitch seems to send data to slow for 2x. 1.5x seems to work for me.

Speed URL
0.5x javascript:document.querySelectorAll("audio,video").forEach(e=>e.playbackRate=0.5);void(0)
1x javascript:document.querySelectorAll("audio,video").forEach(e=>e.playbackRate=1);void(0)
1.25x javascript:document.querySelectorAll("audio,video").forEach(e=>e.playbackRate=1.25);void(0)
@shu8
shu8 / soLinkExpander.user.js
Last active April 16, 2017 11:07
Userscript that expands links to Stack Overflow questions in Google Search
// ==UserScript==
// @name Stack Overflow result expander in Google Search
// @namespace stackexchange.com/users/4337810/
// @version 1.0
// @description Expands links to Stack Overflow questions in Google Search
// @author ᔕᖺᘎᕊ (stackexchange.com/users/4337810/)
// @match *://*.google.com/search*
// @match *://*.google.co.uk/search*
// @require https://code.jquery.com/jquery-2.2.4.min.js
// @grant none
@xavriley
xavriley / README.md
Last active January 8, 2023 12:03
Arpeggiator in Sonic Pi

Arpeggiator in Sonic Pi

This is a work in progress

@dideler
dideler / unique.py
Last active April 8, 2024 04:17
Removing duplicate lines from a file in Python
#!/usr/bin/python
"""
Playing around with slightly various ways to simulate uniq in Python.
The different strategies are timed.
Only m1() and m2() do not change the order of the data.
`in` is the input file, `out*` are output files.
"""
infile = 'in' # Change filename to suit your needs.