Skip to content

Instantly share code, notes, and snippets.

View X1011's full-sized avatar

dan smith X1011

View GitHub Profile
@olphil99
olphil99 / lastfm-remove-duplicates.js
Last active August 12, 2019 04:20 — forked from sk22/lastfm-remove-duplicates.js
Last.fm duplicate scrobble deleter
let elements = Array.from(document.querySelectorAll('.chartlist-row'));
let mapp = new Map();
elements.forEach(function(elem, i, elems) {
let today = new Date(Date.now());
let elemArr = new Array(2);
let nameElement = elem.querySelector('.chartlist-name');
let timeStamp = elem.querySelector('.chartlist-timestamp');
if (timeStamp && timeStamp.textContent.includes('ago')) {
@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()
})
anonymous
anonymous / gmailAutoarchive.js
Created January 8, 2017 16:39
function gmailAutoarchive() {
var delayDays = 2; // will only impact emails more than 48h old
var maxDate = new Date();
maxDate.setDate(maxDate.getDate()-delayDays); // what was the date at that time?
// Get all the threads labelled 'autoarchive'
var label = GmailApp.getUserLabelByName("autoarchive");
var threads = label.getThreads(0, 400);
@Wizmann
Wizmann / workflowy-with-image.js
Last active June 14, 2023 13:29
workflowy-with-image.js
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://workflowy.com/*
// @grant none
// ==/UserScript==
/* jshint -W097 */
@LeCoupa
LeCoupa / bash-cheatsheet.sh
Last active May 5, 2024 00:12
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@OverZealous
OverZealous / build.config.js
Last active June 21, 2021 04:12
Preliminary Gulpfile for replicating ngBoilerplate — Still a work in progress!
/**
* This file/module contains all configuration for the build process.
*/
/**
* Load requires and directory resources
*/
var join = require('path').join,
bowerrc = JSON.parse(require('fs').readFileSync('./.bowerrc', {encoding: 'utf8'})),
bowerJSON = bowerrc.json.replace(/^\.?\/?/, './'),
@v6ak
v6ak / ts-finished
Last active January 4, 2020 10:45
A handler for Task spooler
#!/bin/bash
# Copyright (C) 2012 Vít Šesták <v6ak.com>
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
# http://www.wtfpl.net/ for more details.
# This utility notifies about completed messages of Task spooler (see http://viric.name/soft/ts/).
# Just add the path to this utility to $TS_ONFINISH.
@mislav
mislav / _readme.md
Last active March 28, 2024 00:47
tmux-vim integration to transparently switch between tmux panes and vim split windows

I use tmux splits (panes). Inside one of these panes there's a Vim process, and it has its own splits (windows).

In Vim I have key bindings C-h/j/k/l set to switch windows in the given direction. (Vim default mappings for windows switching are the same, but prefixed with C-W.) I'd like to use the same keystrokes for switching tmux panes.

An extra goal that I've solved with a dirty hack is to toggle between last active panes with C-\.

Here's how it should work:

@inhies
inhies / GPL.md
Last active December 15, 2015 00:18 — forked from jnrbsn/GPL.md
Markdown formatted version of the GPLv3 license.

GNU GENERAL PUBLIC LICENSE

Version 3, 29 June 2007

Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>

Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.

@johan
johan / README.md
Last active April 12, 2024 11:14
A micro-library (4k minified) for DRY:ing up the boring boilerplate of user scripts.

The fun part of user scripting is deciding what happens. The boring part is scavenging the DOM for bits of templated data, or elements you want to mod.

Have on.js do it for you!