Skip to content

Instantly share code, notes, and snippets.

@tomcritchlow
tomcritchlow / bookmarklet.js
Created February 4, 2022 21:13
Gist code for Electric Tables V0.2.
// Convert this JS code into a bookmarklet using a tool like: http://js.do/blog/bookmarklets/
// Be sure to add your own macro_url and spreadsheet_url
var macro_url = "THIS IS YOUR MACRO URL";
var spreadsheet_id = "THIS IS YOUR SPREADSHEET URL";
var iframe = document.createElement("iframe");
iframe.setAttribute("name","dummyframe");
iframe.setAttribute("id","dummyframe");
iframe.setAttribute("style","display:none;");
@RayPS
RayPS / convert-clipboard-image.py
Last active October 19, 2023 12:27
Converting image format in clipboard - macOS Python (Copied as PNG, Paste as JPG)
from PIL import Image
import io
import pasteboard
pb = pasteboard.Pasteboard()
pb_image = pb.get_contents(pasteboard.TIFF)
if pb_image:
image = Image.open(io.BytesIO(pb_image))
if image.mode == 'RGBA':
image.load()
@mansam
mansam / gist:9332445
Created March 3, 2014 19:13
Audio device detection w/ pyaudio
# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 006: ID 05e3:0606 Genesys Logic, Inc. USB 2.0 Hub / D-Link DUB-H4 USB 2.0 Hub
Bus 001 Device 009: ID 1130:f211 Tenx Technology, Inc. TP6911 Audio Headset
# cat d.py
import pyaudio