Skip to content

Instantly share code, notes, and snippets.

Michael Lynn pudquick

Block or report user

Report or block pudquick

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:3795253
# Workaround for default editable text entries on OS X .. sadly relies on curses
import curses, curses.textpad
from curses.textpad import Textbox
screen = curses.initscr()
curses.savetty()
curses.noecho()
class BackspaceTextbox(Textbox):
View keyboard.py
import base64
from scene import *
from PIL import Image
def load_keyboard(retina_display = False):
kb_filename = "keyboard.png"
if retina_display:
kb_filename = "keyboard@2x.png"
kb_image = load_image_file(kb_filename)
if not kb_image:
@pudquick
pudquick / pipista.py
Created Nov 20, 2012
pipista - pip module (for installing other modules) for Pythonista
View pipista.py
import os, os.path, sys, urllib2, requests
class PyPiError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
def _chunk_report(bytes_so_far, chunk_size, total_size):
if (total_size != None):
View mobile.py
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>FullScreen</key>
<true/>
<key>IsRemovable</key>
<true/>
@pudquick
pudquick / webclip.py
Created Nov 22, 2012
Create webclippings in Pythonista
View webclip.py
import uuid, BaseHTTPServer, select, types, clipboard, console
from SimpleHTTPServer import SimpleHTTPRequestHandler
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
global mobile_config_str
mobile_config_str = ''
@pudquick
pudquick / shellista.py
Last active Jan 20, 2019
Advanced shell for Pythonista
View shellista.py
import os, cmd, sys, re, glob, os.path, shutil, zipfile, tarfile, gzip
# Credits
#
# The python code here was written by pudquick@github
#
# License
#
# This code is released under a standard MIT license.
#
View process.py
import sys, os.path
settings_file = sys.argv[1]
id_list_file = sys.argv[2]
f = open(settings_file)
settings = f.read()
f.close()
f = open(id_list_file)
ids = f.read()
View golf.py
import sys, os.path
with open(sys.argv[1]) as f, open(sys.argv[2]) as g:
settings = [x for x in f.read().split('\n')]
ids = g.read().split()
mode = 0
for i, line in enumerate(settings):
if line.strip():
if (mode == 0) and line.startswith('[') and (line.strip('[]') in ids): mode = 1
if (mode == 1): settings[i] = ';' + settings[i]
else: mode = 0
View itunes_library.py
import sqlite3, plistlib
tracks_cmap = {'Album' :'album',
'Album Rating' :'album_rating',
'Artist' :'artist',
'Comments' :'comments',
'Compilation' :'compilation',
'Composer' :'composer',
'Disabled' :'disabled',
'Disc Count' :'disc_count',
@pudquick
pudquick / pipista.py
Created Dec 17, 2012
Version 2.0 of pipista - Unstable branch :)
View pipista.py
import os, os.path, sys, urllib2, requests, tempfile, zipfile, shutil, gzip, tarfile
__pypi_base__ = os.path.abspath(os.path.dirname(__file__))
class PyPiError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
You can’t perform that action at this time.