I suppose most of you have heard of Slack – the nice chat application.

They have both a HTTP API and a RTM API based over WebSockets. I wrote BigSlacker for an ongoing communicatio project. BigSlacker tries to make it easy to use the RTM API. You can write plugins simply by inheriting from the class BasePlugin and start getting events and replying messages. It supports both Python 2 and 3.

By simply inheriting from BasePlugin you create a plugin. You can listen on events by simply defining methods that have the same name as the name of the event – you can see a list here.

Sending a message back

We analyze every returned data from any Plugin we call. If you return None we do nothing. However, if you reply with [(channel, message)], we will automatically send that message to the specified channel.

For whoever doesn’t know, Fleep is a chat application that focuses on being simple, fast and has the ambition of replacing your email. Having used Fleep, Slack and Hipchat, they all have their places. But if you or your team deal with a lot of contacts outside your organization, Fleep it’s certainly something to consider as E-Mail integration is quite a powerful feature as it allows you to add email-based guests to conversation without requiring them to have a Fleep account.

That said, I am developing a ongoing project and for that I would need access to Fleep API. It is a simple RESTful API, however I could not find a proper Python client for it. So I coded this library in a couple days that access Fleep.

Its usage is quite simple and tries to stay as closely to the API as possible.

Here are a few examples:

Creating a chat room with topic and an initial message.

The example below logins, creates a chat room with three people and sends a message. The message uses some of Fleep styling features, check them out here.

So, I thought I could share an amazing collection of videos from conferences and engineering blogs from big companies (think Instagram, PayPal, Dropbox, etc…). No secrets or big deal, just a centralized place with some rather nice resources.

There is not a lot of videos on tool “X” or “Y”, but rather a lot of high-level conceptual talks in terms of videos. That’s my particular choice when looking for something to watch. I like to believe that when we understand the deeper roots of a particular issue, all the rest are just tools. In another words, be on the lookout if it’s really a nail, only then, run for the hammer.

However, the engineering blogs usually get a bit more into how they used a specific tool or another. But the important part is always try to understand why they chose something over another thing. It’s funny to realize the mistakes they make sometimes when we could have thought that in those big flashy nice companies, things like that would hardly happen.

A big role is also played in the balance of risk-taking when going for new (although proven) technologies. That can be a real advantage in such competitive times and they know that.

And well, I just thought someone might make good use of all of this. This is knowledge in what I believe is its purest form: community-driven. So I’m trying to pass it along as well.

If you know of something else, let me know in the comments and I’ll update the list.

For the videos, I’ve created a playlist (which I will keep adding stuff as I find/watch):

txsh is a dynamic wrapper around Twisted ProcessProtocol and spawnProcess that allows you to call any program as if it were a function and return a deferred with its exit code and output. If you wanna know what it does, check out my first release post.

Version 0.2 introduces a few new features and bug fixes.

– Support to subcommands. It looks nice to be able to do “git.branch(“-v”)” instead of “git(“branch”, “-v”)”

– Redirection of stderr and stdout to any file-like object, deferred, deffered queue or callable. If a string is passed, we will assume it’s a filename we can open and write to it.

– Added a few unit tests.

– Fixed a bug where the subcommand was not being properly passed on .bake call.

Examples:

from txsh import ls, curl, wc, git, sudo
# arguments should go separated
d = ls("-l","-h")# ls -l -h# Keyword arguments are also supported
d = ls(help=True)# ls --help# Underscores will be replaced by dashes
d = curl(connect_timeout=10, url="http://something")# curl --connect-timeout 10 --url http:/something# You can pipe
d = wc(ls())# You can have subcommands
d = git.branch()# Same as git("branch")
d = sudo.ls("-h")# Same as sudo("ls", "-h")# You can bake
ll = ls.bake("-l","-h")
d = ll()# Now ll will always output ls -l -h# You can redirect stderr or stdout to a file using special args _out and _err
d = ls("-l", _out=open('output.log','wb'))# In fact, you can use any file-like object like a StringIO.# A callabble.def alert(error):
pass# Do something
d = ls("-l", _err=alert)# Will redirect stderr to alert function.# If you pass a string, we will simply assume it's a filename.
d = ls("-l", _out="output.log", _err="error.log")# You can also pass a DeferredQueue or a simple Deferred.
queue = DeferredQueue()
my_defer = Deferred()
d = ls("-l", _out=queue, _err=my_defer)# When stdout is ready, it will call queue.put# When stderr is ready, it will call my_defer.callback