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
/* | |
* Copyright (C) 2004-2011 See the AUTHORS file for details. | |
* | |
* This program is free software; you can redistribute it and/or modify it | |
* under the terms of the GNU General Public License version 2 as published | |
* by the Free Software Foundation. | |
*/ | |
#include "User.h" |
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/sh | |
address="https://localhost:8081/stats" | |
count_type=$1 | |
if [[ "$count_type" != "user" && "$count_type" != "channel" ]]; then | |
echo "Usage: $0 <user|channel>" | |
exit 1 | |
elif |
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
extern "C" { | |
#include <ykclient.h> | |
} | |
#include <znc/Modules.h> | |
#include <znc/znc.h> | |
#include <znc/User.h> | |
#define CLIENT_ID 1 | |
#define DEFAULT_TOKEN_ID_LEN 12 |
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
#include "Modules.h" | |
#include "Chan.h" | |
class CCraftIRC : public CModule { | |
public: | |
MODCONSTRUCTOR(CCraftIRC) { | |
AddHelpCommand(); | |
AddCommand("Alias", static_cast<CModCommand::ModCmdFunc>(&CCraftIRC::AliasCommand), "username [nick]"); | |
AddCommand("Nick", static_cast<CModCommand::ModCmdFunc>(&CCraftIRC::NickCommand), "nick", "Set the nickname the CraftIRC bot uses."); | |
} |
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 | |
case $1 in | |
config) | |
echo "graph_title Channel count" | |
echo "graph_vlabel channels" | |
echo "channels.label channels" | |
echo "channels.draw AREA" | |
;; | |
*) |
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
pkgname=lxc | |
pkgver=0.7.4.2 | |
pkgrel=1 | |
pkgdesc="Linux Containers" | |
arch=('i686' 'x86_64') | |
url="http://lxc.sourceforge.net/" | |
depends=('bash' 'perl') | |
license=('LGPL') | |
source=("http://lxc.sourceforge.net/download/lxc/$pkgname-$pkgver.tar.gz" lxc.rcd lxc.confd) | |
md5sums=('36fcb0f6a39d2f55130421f342f24ef3' '520594461912e084c220ca37eb97afd2' 'efb0c46839136842e9d3617924a9b5b5') |
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
from random import randint | |
from django.http import HttpResponse | |
class HTCPCPMiddleware(object): | |
""" | |
This middleware allows a your django project to act as a HTCPCP (Hyper | |
Text Coffee Pot Control Protocol) server. If the user requests to BREW | |
a coffee, and it is not on the list. Then it will get a `406 Not | |
Acceptable`, and randomly it will respond with `418 I'm a teapot`. | |
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
web: gunicorn -w 4 serve:wsgi |
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
/* | |
HTTP Link header parser (http://tools.ietf.org/html/rfc5988) | |
License: BSD | |
NSDictionary *links = KFParseRelativeLinks(@"<http://github.com?page=2>; rel=next"); | |
NSURL *nextURL = links[@"next"]; | |
*/ | |
NSDictionary *KFParseRelativeLinks(NSString *header) { | |
NSMutableDictionary *links = [[NSMutableDictionary alloc] init]; |
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
# This simple python utility crawls the current directory and finds all images. | |
# It will then search the directory for files using these images and also mark | |
# any xcode projects which include these images. | |
# | |
# Allowing you to easily find images which are no longer used (or even images | |
# included in xcode and not used). | |
# | |
# Usage, cd into your repository and then run: | |
# | |
# curl https://gist.github.com/kylef/6316920/raw/images.py -# | python - |