Skip to content

Instantly share code, notes, and snippets.

@drunkensouljah
drunkensouljah / gistcheck.py
Created June 15, 2016 17:45 — forked from jsbain/gistcheck.py
updated comment: prevent opening of pyui in editor
# Source: https://gist.github.com/5212628
#
# All-purpose gist tool for Pythonista.
#
# When run directly, this script sets up four other scripts that call various
# functions within this file. Each of these sub-scripts are meant for use as
# action menu items. They are:
#
# Set Gist ID.py - Set the gist id that the current file should be
# associated with.
# -*- coding: utf-8 -*-
# Created by Sebastian Jarsve
# 9. April 2013
from scene import *
from sound import play_effect
from random import randint
def centered_rect(x, y, w, h):
return Rect(x-w/2, y-h/2, w, h)
@drunkensouljah
drunkensouljah / shellista.py
Created June 15, 2016 17:36 — forked from pudquick/shellista.py
Advanced shell for Pythonista
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.
#
@drunkensouljah
drunkensouljah / Meme Generator 2.py
Created June 15, 2016 17:36 — forked from omz/Meme Generator 2.py
Meme Generator 2
import Image
import ImageChops
import ImageDraw
import ImageFont
import ImageFilter
import clipboard
def draw_caption(img, text, outline=2, top=False):
text_img = Image.new('RGBA', img.size, (0, 0, 0, 0))
draw = ImageDraw.Draw(text_img)
# Simple installer script for using the Evernote SDK in Pythonista
#
# This script should be run from the root directory. In order to keep things
# tidy, it installs the module and all its dependencies in a directory named
# 'evernote-sdk'. In order to be able to import it, you have to add that to
# your import path, like this:
#
# import sys
# sys.path.append('evernote-sdk')
#
@drunkensouljah
drunkensouljah / SSHClient.py
Created June 15, 2016 17:34 — forked from omz/SSHClient.py
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
@drunkensouljah
drunkensouljah / PythonistaBackup.py
Created June 15, 2016 17:34 — forked from omz/PythonistaBackup.py
PythonistaBackup.py
# coding: utf-8
'''Creates a zip archive of your Pythonista files and serves them via HTTP in your local network.'''
from SimpleHTTPServer import SimpleHTTPRequestHandler
import os
import shutil
import tempfile
import shutil
PORT = 8080
@drunkensouljah
drunkensouljah / latest_draft.py
Created June 15, 2016 17:25 — forked from philgruneich/latest_draft.py
Open latest Draft article on either Byword or 1Writer
from requests import get
from json import loads
from urllib import quote
from webbrowser import open
email = 'YOUR EMAIL'
password = 'YOUR PASSWORD'
r = get('https://draftin.com/api/v1/documents.json', auth=(email,password))
@drunkensouljah
drunkensouljah / Top Apps.py
Created June 15, 2016 17:02 — forked from omz/Top Apps.py
Top Apps
# Shows a list of the 10 top paid apps on the App Store.
print 'Loading...'
import feedparser
import console
print 'Fetching Feed...'
feed = feedparser.parse('http://itunes.apple.com/us/rss/toppaidapplications/limit=10/xml')
entries = feed['entries']
@drunkensouljah
drunkensouljah / .zshrc
Created June 7, 2016 19:05 — forked from tansengming/.zshrc
.zshrc
ZSH=$HOME/.oh-my-zsh
ZSH_THEME="gallois"
setopt HIST_FIND_NO_DUPS
setopt histignorealldups
alias x='exit'
alias desk='cd ~/Desktop'
alias rm='grm -v'