Skip to content

Instantly share code, notes, and snippets.

View FSX's full-sized avatar
💭
I may be slow to respond.

Frank FSX

💭
I may be slow to respond.
View GitHub Profile
# Medit Gist Tool (Tools menu)
#
# Options: need-doc,need-save
# Command type: Shell command
# Input: None
# Output: None,Asynchronous
# Filter: Default
if which gxmessage>/dev/null; then
DIALOGBIN=gxmessage
<?php
/* ---
A really simple Atom/XML parser with caching.
Usage:
try
We couldn’t find that file to show.
#!/usr/bin/env python
"""Indents and wraps text, but doesn't touch docblocks."""
import re
import hashlib
import textwrap
"""
Url: http://61924.nl/posts/00038-whoosh
Example:
>>> from searchengine import *
>>> search = SearchEngine('./index')
>>> search.create_index()
>>> search.add_document('http://example.org/somedocument',
'The document title', 'The content of the document')
@FSX
FSX / evenniaclient.py
Created October 16, 2010 13:16
A simple client for the Evennia MUX server.
# -*- coding: utf-8 -*-
"""
evenniaclient
~~~~~~~~~~~~~
A simple client for the Evennia MUX server.
Website: http://evennia.com/
"""
@FSX
FSX / textadept-3.3-content-menu-buffer-list.patch
Created October 22, 2010 15:35
Replaced the context menu in Textadept with a list of buffers.
--- a/menu.lua 2010-10-01 03:52:19.000000000 +0200
+++ b/menu.lua 2010-10-22 17:29:37.136666674 +0200
@@ -11,6 +11,7 @@
local gui = gui
local l = locale
local gtkmenu = gui.gtkmenu
+local context_mbl = {} -- Context menu buffer list
local SEPARATOR = 'separator'
local ID = {
@FSX
FSX / randwp.py
Created October 22, 2010 21:08
Grabs a random wallpaper from the wallbase.net toplist.
#!/usr/bin/env python
"""
randwp
~~~~~~
Fetches random wallpapers from the wallbase.net toplist and sets it as the
background.
This script needs Python 3.*. Windows people need to install the `pywin32`_
and Mac OS X people need to install `py-appscript`_.
@FSX
FSX / xsrf.php
Created January 14, 2011 12:49
A simple anti-XSRF class.
<?php
/**
* A simple anti-XSRF class.
*/
class xsrf
{
static private $_token = false;
/**
@FSX
FSX / passwdchkr.js
Created February 25, 2011 18:39
A password strength checker plugin for jQuery
// Usage: $('input.pwstrnth').pwstrnth();
// Password strength checker plugin
;(function ($, window, undefined) {
var pluginName = 'pwstrnth',
document = window.document,
indicators = [' ', ':\'(', ':(', ':|', ':)', ':D'],
regexes = [/.{8,}/, /[a-z]+/, /[0-9]+/, /[A-Z]+/, /[\/?<>,.\[\]{}()*&^%$#@!;:|]/];
function Plugin(element) {