View membash.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Gist: 11375877 | |
# Url: https://gist.github.com/goodevilgenius/11375877 | |
# | |
# All memcache functions are supported. | |
# | |
# Can also be sourced from other scripts, e.g. | |
# source membash.sh | |
# MCSERVER="localhost" |
View fortune_variety_quotes.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from variety.plugins.IQuoteSource import IQuoteSource | |
import subprocess, re | |
from locale import gettext as _ | |
class FortuneSource(IQuoteSource): | |
@classmethod | |
def get_info(cls): | |
return { |
View cheat_sheet.org.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cheat_sheet.org.sh | |
# 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 ~/path_to_cheat_sheet.org.sh" | |
# | |
# Originally by WilliamHackmore: https://github.com/WilliamHackmore/linuxgems | |
# This version by goodevilgenius: https://gist.github.com/goodevilgenius/2d1c01251c524610a2cd |
View ternary.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func Tern[V any](choice bool, one, two V) V { | |
if choice { | |
return one | |
} | |
return two | |
} |
View empty-yt-playlist.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function clickRemove() { | |
const button = [...document.querySelectorAll('.yt-formatted-string')].find(el => el.innerText === 'Remove from '); | |
if (!button) { | |
console.log("Can't find remove button"); | |
return; | |
} | |
button.click(); | |
setTimeout(emptyList, 1); | |
} |
View promise-queryable.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 => { |
View dl_json.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* global $, data */ | |
// data should be the object/array/etc to be JSON-ified. | |
// First, with jQuery | |
var $el = $('<a>'); | |
$(document.body).append($el); | |
// If data is a jQuery selector, then do data = data.toArray() |
View spy.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* 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. | |
* |
View pushover.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Assuming you name the file pushover.sh, place somewhere within your $PATH, then chmod +x /path/to/pushover.sh | |
# Invoke with: pushover.sh [-d device_name] [-t Title] [-u Url] [-ut URL Title] [-p] [-ts timestamp] "notifcation text" | |
token="" | |
user="" | |
test -f ~/.pushover && source ~/.pushover # Put your API token and user key here |
View wordpress-rss-atom-updated.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @version 0.1 | |
*/ | |
/* | |
Plugin Name: Atom:Updated | |
Plugin URI: https://gist.github.com/goodevilgenius/9786001 | |
Description: This plugin adds atom:updated to your RSS2 feed | |
Author: Dan Jones | |
Version: 0.1 |
NewerOlder