Skip to content

Instantly share code, notes, and snippets.

@Ircama
Ircama / PT-P300BT.md
Last active July 1, 2024 10:48
Print to Brother PTP300BT from a computer

Printing to a Brother P-Touch Cube PT-P300BT label printer from a computer

Introduction

The Brother P-touch Cube PT-P300BT labelling machine is intended to be controlled from the official Brother P-touch Design&Print 2 app for Android and iOS devices, instead of from a computer.

This Gist provides small code revision and some additional scripts to the dogtopus/Pipfile one, which in turn is forked from the excellent stecman one, in order to print text labels via scripts on computers with different O.S. or subsystems.

The scripts are used to convert text labels to appropriate images compatible with 12mm width craft tapes like [TZe-131

@sk22
sk22 / lastfm-remove-duplicates.js
Last active January 13, 2024 16:26
Last.fm duplicate scrobble deleter
var elements = Array.from(document.querySelectorAll('.js-link-block'))
elements.map(function (element) {
var nameElement = element.querySelector('.chartlist-name')
return nameElement && nameElement.textContent.replace(/\s+/g, ' ').trim()
}).forEach(function (name, i, names) {
if (name !== names[i + 1]) return
var deleteButton = elements[i].querySelector('[data-ajax-form-sets-state="deleted"]')
if (deleteButton) deleteButton.click()
location.reload()
})
@trent2
trent2 / unob_spiegelplus.user.js
Last active February 22, 2022 06:47
Unobfuscate SPIEGEL plus articles with greasemonkey
// ==UserScript==
// @name unobfuscate spiegel plus
// @namespace obfuscate
// @include http://www.spiegel.de/*
// @version 1
// @grant none
// ==/UserScript==
if(document.getElementsByClassName('obfuscated-content')[0] != undefined) {
document.getElementsByClassName('obfuscated-content')[0].setAttribute("class", "");
var elems = document.getElementsByClassName('obfuscated'), t, or, c, i, cc;
@jburgess777
jburgess777 / getButton.py
Created February 23, 2016 23:11
Script to find a Bluetooth camera remote and print the button events
#!/usr/bin/env python
import sys
import evdev
devices = [evdev.InputDevice(fn) for fn in evdev.list_devices()]
if len(devices) == 0:
print "No devices found, try running with sudo"
sys.exit(1)
@groovenectar
groovenectar / roundedcube.scad
Last active April 6, 2024 04:40
roundedcube.scad - Fork me and make me better!
// More information: https://danielupshaw.com/openscad-rounded-corners/
// Set to 0.01 for higher definition curves (renders slower)
$fs = 0.15;
module roundedcube(size = [1, 1, 1], center = false, radius = 0.5, apply_to = "all") {
// If single value, convert to [x, y, z] vector
size = (size[0] == undef) ? [size, size, size] : size;
translate_min = radius;
#!/usr/bin/env python
"""IMAP Incremental Backup Script v.1.4c (Dec 12 2009) found on http://the.taoofmac.com/space/Projects/imapbackup"""
__version__ = "1.4c"
__author__ = "Rui Carmo (http://the.taoofmac.com)"
__copyright__ = "(C) 2006 Rui Carmo. Code under BSD License.\n(C)"
__contributors__ = "Bob Ippolito, Michael Leonhard, Giuseppe Scrivano <gscrivano@gnu.org>, Ronan Sheth, Brandon Long"
# = Contributors =
# Brandon Long (Gmail team): Reminder to use BODY.PEEK instead of BODY