Skip to content

Instantly share code, notes, and snippets.

@fhats
fhats / m_sanick.c
Created February 8, 2015 16:39
sanick for unreal IRCd. Originally found at https://pub.maff.me.uk/code/m_sanick.c
/*
* Unreal Internet Relay Chat Daemon, src/modules/m_sanick.c
* (C) 2000-2001 Carsten V. Munk and the UnrealIRCd Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 1, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,

Keybase proof

I hereby claim:

  • I am fhats on github.
  • I am fhats (https://keybase.io/fhats) on keybase.
  • I have a public key whose fingerprint is 02B2 0441 9399 BC2B 0BC6 4EAB FED1 B7C5 911F F0BB

To claim this, I am signing this object:

$ znc-buildmod clientbuffer.cpp
Building "clientbuffer.so" for ZNC 1.4... clientbuffer.cpp:33:44: warning: override controls (override/final) only available with -std=c++11 or -std=gnu++11 [enabled by default]
virtual EModRet OnUserRaw(CString& line) override;
^
clientbuffer.cpp:34:66: warning: override controls (override/final) only available with -std=c++11 or -std=gnu++11 [enabled by default]
virtual EModRet OnSendToClient(CString& line, CClient& client) override;
^
clientbuffer.cpp:36:70: warning: override controls (override/final) only available with -std=c++11 or -std=gnu++11 [enabled by default]
virtual EModRet OnChanBufferStarting(CChan& chan, CClient& client) override;
^
@fhats
fhats / flask_routes_in_doc
Created December 11, 2011 03:26
Subclass of Flask to automatically store routes in the view handler's docstrings
class FlaskWithRouteDocs(Flask):
"""A subclass of Flask to allow using :route: and :methods: in docstrings, a la Sphinx."""
def route(self, rule, **options):
def decorator(f):
route_dec = super(FlaskWithRouteDocs, self).route(rule, **options)
methods_str = ','.join(options.get('methods', ['GET']))
if f.__doc__ is not None and ":route:" in f.__doc__:
f.__doc__ = f.__doc__.replace(":route:", rule)
else:
@fhats
fhats / tastes.py
Created February 7, 2011 16:02
Last.FM Tag Cloud Retriever
lastfm_api_key = "295e485894bdf30203b53607f1d94e34"
lastfm_api_root = "http://ws.audioscrobbler.com/2.0/"
result_limit = 15
import urllib
import urllib2
import json
import string
def getLastFmJson(args):