Skip to content

Instantly share code, notes, and snippets.

View paultopia's full-sized avatar

Paul Gowder paultopia

View GitHub Profile
@paultopia
paultopia / makeslide.py
Last active May 3, 2017 20:41 — forked from aaronwolen/slides.md
Pandoc template to generate reveal.js slideshows. (corrected from original to be compatible with 3.2.0 release of reveal.js); also added a quick python script to generate with less command-line ugliness.
import argparse
# this first bit is to enable multiline help text. apparently this is a known problem with argparse.
# Solution jacked from http://stackoverflow.com/questions/3853722/python-argparse-how-to-insert-newline-in-the-help-text
import textwrap as _textwrap
class MultilineFormatter(argparse.HelpFormatter):
def _fill_text(self, text, width, indent):
text = self._whitespace_matcher.sub(' ', text).strip()
paragraphs = text.split('|n ')
@paultopia
paultopia / SSHClient.py
Last active August 29, 2015 14:23 — forked from omz/SSHClient.py
# Very simple SSH client for Pythonista
import paramiko
import console
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
host = console.input_alert('Connect to')
user, passwd = console.login_alert('Login')
ssh.connect(host, username=user, password=passwd)
print 'Connected to %s. Type `exit` to disconnect.' % host
'''FTP server for Pythonista (iOS)
You can use this to exchange files with a Mac/PC or a file management app on the same device (e.g. Transmit).
If you use a Mac, you can connect from the Finder, using the "Go -> Connect to Server..." menu item.
'''
import os
from socket import gethostname