Skip to content

Instantly share code, notes, and snippets.

@russell
russell / gist:3126357
Created July 17, 2012 01:35
auto-complete for python-mode using python-shell-completion
(defun ac-python-candidates ()
(let* (py-split-windows-on-execute-p
py-switch-buffers-on-execute-p
(shell (py-choose-shell))
(proc (or (get-buffer-process shell)
(get-buffer-process (py-shell nil nil shell 'noswitch nil)))))
(if (processp proc)
(with-syntax-table python-dotty-syntax-table
(let* ((imports (py-find-imports))
@russell
russell / .mbsyncrc
Created September 17, 2013 00:16
ISync & Dovecot Configuration
IMAPAccount gmail-account
Host imap.gmail.com
User user@gmail.com
UseIMAPS yes
CertificateFile /etc/ssl/certs/ca-certificates.crt
Pass "secret"
IMAPStore gmail-store
Account gmail-account
@russell
russell / skel.py
Last active August 29, 2015 13:57
A starting point for python scripts.
#!/usr/bin/python
import logging
log = logging.getLogger(__file__)
def main():
"""An example of how the logging works."""
log.debug("Test message")
@russell
russell / 400.py
Created April 11, 2014 00:21
The worst http server ever
# -*- coding: utf-8 -*-
import SocketServer
import SimpleHTTPServer
PORT = 8000
class HTTPServer(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_GET(self):
%cylinder(2, r=8);
module spiral_part(angle, height, distance, radius) {
rotate(angle, [0, 0, 1])
translate([distance, 0, 0 ])
rotate([90,0,0])cylinder(height, r = r, $fn=5);
}
module spiral(){
height =1;
union (){