Skip to content

Instantly share code, notes, and snippets.

function crash_wow()
local model = CreateFrame("PlayerModel")
model:SetWidth(300)
model:SetHeight(300)
model:SetPoint("CENTER", WorldFrame)
model:SetCreature(83008)
end
@kemayo
kemayo / slack-skype.coffee
Created January 26, 2015 15:16
Hubot plugin to drop a skype conference call link into the chat
# Description
# Drop a link into chat which will work as a skype conference call for the requested user
#
# Dependencies:
# "slack-node": "^0.0.95"
# "hubot-slack-attachment": "^1.0.0"
#
# Configuration:
# HUBOT_SLACK_TOKEN
# HUBOT_SLACK_INCOMING_WEBHOOK
[
{
"path": "SilverDragon",
"repo": "wow-silverdragon",
"curse": "silver-dragon",
"wowi": "6606",
"changelog": true
},
{
"path": "BankStack",
@kemayo
kemayo / git-foreach
Last active November 26, 2015 21:16
A git utility for my own use, here so I don't forget about it
#!/bin/bash
for D in *; do
if [ -d "${D}/.git" ]; then
echo "${D}:" "${1:-pull}" "${@:2}"
git -C "${D}" "${1:-pull}" "${@:2}"
fi
done
// ==UserScript==
// @name Xenforo invisitext
// @namespace http://davidlynch.org/
// @version 0.1
// @description Make some invisible text a little more visible
// @author David Lynch
// @match https://forums.sufficientvelocity.com/*
// @match https://forums.spacebattles.com/*
// @match https://forums.questionablequesting.com/*
// @match https://xenforo.com/community/*
// ==UserScript==
// @name Gerrit: Remove size from searchbox
// @namespace http://davidlynch.org/
// @version 0.1
// @description Searchbox too wide; removing its size attribute helps there
// @author David Lynch <kemayo@gmail.com>
// @match https://gerrit.wikimedia.org/*
// @grant none
// ==/UserScript==
@kemayo
kemayo / luaparse.py
Created September 1, 2016 05:19
Parse lua table syntax in python
import ply.yacc as yacc
import ply.lex as lex
""" Lua table syntax parser
Important reference: http://www.lua.org/manual/5.1/manual.html#8
This is incomplete. It parses enough of Lua's syntax to handle non-fancy
tables. In the official grammar provided in the manual, it starts at
"tableconstructor". It has no support for functions, or for complicated
@kemayo
kemayo / visualeditor-onboard.markdown
Last active May 20, 2017 13:49
Overview of Mediawiki VisualEditor concepts

VisualEditor: Getting Started With Development

VisualEditor is a WYSIWYG editor, developed primarily for use with Mediawiki. It is a general purpose editor and can be integrated anywhere. As such, it's maintained in two parts:

  • VisualEditor core
    • The basic editor component
  • Mediawiki-VisualEditor
    • Integration with Mediawiki, including wikitext support and various wiki-specific element types
    • Relies on Parsoid, a service that translates between HTML and wikitext
    • Other MW extensions include components that add support for their
@kemayo
kemayo / clicktest.py
Last active October 30, 2017 04:24
Test for click, of somewhat abusive dynamic subcommand creation and argument passing.
import re
import click
# This is obviously a placeholder for testing purposes, and would actually use Site.matches
sites = {}
for site in ('archiveofourown', 'fanfiction', 'spacebattles'):
@click.command()
@click.argument('url')
def cmd(url, *args, **kwargs):
( function ( $ ) {
$.fn.openInNewWindow = function () {
var rel;
if ( this.tagName.toLowerCase() === 'a' ) {
this.setAttribute( 'target', '_blank' );
rel = this.getAttribute( 'rel' );
this.setAttribute( 'rel', rel ? ( rel + ' noopener' ) : 'noopener' );
}
}
)( jQuery )