Skip to content

Instantly share code, notes, and snippets.

@ZhuoyunZhong
ZhuoyunZhong / 01_Overview.md
Last active May 2, 2025 14:57
Include only parts of others' repository as submodule in your project and arrange them to desired locations.

This gist provides an example of how to only include parts of others' repository as submodule in your project.

What is more, it will also show how to "put" the folders of submodule to desired location (e.g. under your project's root), without breaking the submodule.

Consider we have a repository

Simulation

  • README.md

There is one another repository we want to use, but only the algorithm folder is needed.

@Ircama
Ircama / PT-P300BT.md
Last active February 23, 2025 15:54
Print to Brother PTP300BT from a computer
@sk22
sk22 / lastfm-remove-duplicates.js
Last active April 28, 2025 21:56
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 December 17, 2024 05:23
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 <[email protected]>, Ronan Sheth, Brandon Long"
# = Contributors =
# Brandon Long (Gmail team): Reminder to use BODY.PEEK instead of BODY