Skip to content

Instantly share code, notes, and snippets.

View pawigor's full-sized avatar

Igor Pavlichenko pawigor

View GitHub Profile
@pawigor
pawigor / rtorrent_xmlrpc.py
Created October 5, 2015 13:23 — forked from query/rtorrent_xmlrpc.py
Python module for interacting with rtorrent's XML-RPC interface directly over SCGI.
#!/usr/bin/python
# rtorrent_xmlrpc
# (c) 2011 Roger Que <[email protected]>
#
# Python module for interacting with rtorrent's XML-RPC interface
# directly over SCGI, instead of through an HTTP server intermediary.
# Inspired by Glenn Washburn's xmlrpc2scgi.py [1], but subclasses the
# built-in xmlrpclib classes so that it is compatible with features
# such as MultiCall objects.
@pawigor
pawigor / main.py
Created September 28, 2015 05:59 — forked from leandrotoledo/main.py
Webhook using self-signed certificate and Flask (with python-telegram-bot library)
#!/usr/bin/env python
'''Using Webhook and self-signed certificate'''
# This file is an annotated example of a webhook based bot for
# telegram. It does not do anything useful, other than provide a quick
# template for whipping up a testbot. Basically, fill in the CONFIG
# section and run it.
# Dependencies (use pip to install them):
# - python-telegram-bot: https://github.com/leandrotoledo/python-telegram-bot
for (int i = 0; i < array.length - 1; i++) {
for (int j = i + 1; j < array.length; j++) {
if (array[i] < array[j]) {
int k = array[i];
array[i] = array[j];
array[j] = k;
}
}
}