Skip to content

Instantly share code, notes, and snippets.

goodevilgenius /
Last active November 2, 2023 12:19 — forked from ri0day/
[membash] BASH script which may be used to interact with memcache. All main memcache functions are supported. #memcache
# Gist: 11375877
# Url:
# All memcache functions are supported.
# Can also be sourced from other scripts, e.g.
# source
# MCSERVER="localhost"
goodevilgenius /
Last active October 28, 2023 05:09
[Variety fortune plugin] Plugin for Variety background changer that uses the UNIX fortune program as a quotes source
from variety.plugins.IQuoteSource import IQuoteSource
import subprocess, re
from locale import gettext as _
class FortuneSource(IQuoteSource):
def get_info(cls):
return {
goodevilgenius /
Last active October 22, 2023 12:25
[Linux cheat sheet] A succinct cheat sheet for newbie linux coders and system administrators, documenting some of the more obscure and useful gems of linux lore. Intended to be viewed in emacs org-mode, or VimOrganizer, though any text editor will suffice. #Linux #Unix #POSIX #cli
# The contents of this file are released under the GNU General Public License. Feel free to reuse the contents of this work, as long as the resultant works give proper attribution and are made publicly available under the GNU General Public License.
# Best viewed in emacs org-mode.
# Alternately, one can keep this cheat sheet handy by adding the following line to ~/.bashrc:
# alias cheatsheet="less ~/"
# Originally by WilliamHackmore:
# This version by goodevilgenius:
goodevilgenius / ternary.go
Created September 25, 2023 11:20
A ternary function for go, because why doesn't it already have it?
func Tern[V any](choice bool, one, two V) V {
if choice {
return one
return two
goodevilgenius / empty-yt-playlist.js
Created August 24, 2023 18:00
Empty a YouTube playlist
function clickRemove() {
const button = [...document.querySelectorAll('.yt-formatted-string')].find(el => el.innerText === 'Remove from ');
if (!button) {
console.log("Can't find remove button");
setTimeout(emptyList, 1);
goodevilgenius / promise-queryable.js
Created August 21, 2023 15:16
A javascript promise that can tell you if it's been fulfilled.
Promise.prototype.getQueryable = function () {
if (this.isFulfilled) return this;
let isPending = true;
let isRejected = false;
let isFulfilled = false;
let value = undefined;
let error = undefined;
let result = this.then(v => {
goodevilgenius / dl_json.js
Last active September 24, 2021 18:50
[Download JSON] Force browser to download a JavaScript object as a JSON file, using jQuery, or VanillaJS #webdev #browser #javascript
/* global $, data */
// data should be the object/array/etc to be JSON-ified.
// First, with jQuery
var $el = $('<a>');
// If data is a jQuery selector, then do data = data.toArray()
goodevilgenius / spy.php
Last active September 2, 2021 21:27
Class to access private/protected methods/properties without Reflections. Requires PHP 8 (could be rewritten to support 7)
* Method for accessing private/protected properties/methods without Reflection.
* This is particularly useful when debugging from the command-line, for example, with psysh.
* Static methods/properties can be accessed by passing the class instead.
* Constants are not acccessible.
goodevilgenius /
Last active May 15, 2021 23:32
[bash pushover] Command-line script to send a notification to your mobile device via Pushover. Requires curl. #pushover #notifications #obsolete
# Assuming you name the file, place somewhere within your $PATH, then chmod +x /path/to/
# Invoke with: [-d device_name] [-t Title] [-u Url] [-ut URL Title] [-p] [-ts timestamp] "notifcation text"
test -f ~/.pushover && source ~/.pushover # Put your API token and user key here
goodevilgenius / wordpress-rss-atom-updated.php
Last active February 3, 2020 11:09
[WP atom:updated] Wordpress Plugin to add atom:updated to rss feed #Wordpress #RSS
* @version 0.1
Plugin Name: Atom:Updated
Plugin URI:
Description: This plugin adds atom:updated to your RSS2 feed
Author: Dan Jones
Version: 0.1