This file contains hidden or 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 errbot import BotPlugin, botcmd | |
from pyfiglet import Figlet | |
class AsciiArt(BotPlugin): | |
""" Ascii Art related commands. """ | |
@botcmd(template='biginfo') | |
def big(self, mess, args): | |
""" Generates a big version of what you want to say.""" | |
return {'small': args, 'big': Figlet(font='slant').renderText(args)} |
This file contains hidden or 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 errbot import BotPlugin, botcmd | |
class AsciiArt(BotPlugin): | |
""" Ascii Art related commands. """ | |
@botcmd | |
def big(self, mess, args): | |
""" Generates a big version of what you want to say.""" | |
return args.upper() |
This file contains hidden or 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 errbot import BotPlugin, botcmd | |
from pyfiglet import Figlet | |
class AsciiArt(BotPlugin): | |
@botcmd | |
def big(self, mess, args): | |
return "```\n" + Figlet(font='slant').renderText(args) + "\n```" |
This file contains hidden or 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
[Core] | |
Name = AsciiArt | |
Module = asciiart | |
[Documentation] | |
Description = Make what you say big ! | |
[Python] | |
Version = 3 |
This file contains hidden or 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 errbot import BotPlugin, botcmd | |
from os.path import join | |
DAYS_PATH = 'f:/errplugins/' | |
class School(BotPlugin): | |
@botcmd | |
def missed_day(self, msg, args): | |
"""Get missed day and provide assignment summary.""" | |
with open(join(DAYS_PATH, "summary.%s" % args), 'r') as f: |
This file contains hidden or 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 errbot import BotPlugin, botcmd | |
class PluginMaker(BotPlugin): | |
""" Example demonstrating how to create an errbot plugin out of thin air. | |
This basically generates a plugin from scratch and registers it at activation. | |
""" | |
def activate(self): | |
super().activate() |
This file contains hidden or 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
[Core] | |
Name = HipchatEx | |
Module = hipchatex | |
[Documentation] | |
Description = This is my customized hipchat backend. |
This file contains hidden or 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
## py3 | |
import shelve | |
import dbm | |
import pickle | |
with dbm.open('source', 'r') as source: # no .db here on purpose. | |
with shelve.open('destination.db') as destination: | |
for key in source.keys(): | |
key = key.decode('utf-8') | |
value = pickle.loads(source[key]) | |
print(key, value) |
This file contains hidden or 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/env python3 | |
# | |
# This script is a tool that helps you calculate the potential benefits | |
# in occupied size on disk using the ext4 inlinedata new feature on | |
# Linux kernels 3.8.0+: | |
# "The new Inline Data Support feature allows Ext4 to store files that only consist of a few bytes together with the inode to save storage space and accelerate access" | |
# see http://www.h-online.com/open/features/What-s-new-in-Linux-3-8-1804240.html for details. | |
# | |
# Just run it on your ext4 mountpoints and it will tell give you the trade off |
This file contains hidden or 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 | |
import matplotlib | |
matplotlib.use('Qt4Agg') | |
from datetime import datetime | |
import os | |
DIR = 'data/' | |
dirList=os.listdir(DIR) | |
unzip = lambda l:tuple(zip(*l)) |
NewerOlder