Skip to content

Instantly share code, notes, and snippets.

@jsbain
jsbain / gistcheck.py
Last active November 24, 2022 00:18 — forked from davenicholls/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.
@jsbain
jsbain / h2048.py
Created July 21, 2014 04:42 — forked from henryiii/h2048.py
# -*- coding: utf-8 -*-
"""
Created on Sat Jul 12 09:33:29 2014
@author: henryiii
"""
import random
import numpy as np
from functools import partial
@jsbain
jsbain / h2048.py
Last active August 29, 2015 14:04 — forked from henryiii/h2048.py
# -*- coding: utf-8 -*-
"""
Created on Sat Jul 12 09:33:29 2014
@author: henryiii
"""
import random
import numpy as np
import ui
@jsbain
jsbain / pipista.py
Last active August 29, 2015 14:06 — forked from pudquick/pipista.py
updated v2 to work properly with pythinista 1.5
# pipista v2, by pudquick, updated for pythonista 1.5 by jsbain
# todo: consolidate unzip, ungzip, unbzip, and untar. tarfile supports compressed archives, so can use that directly. use is_zipfile, is_tarfile rather than magic packet stuff. there is a lot of duplicate code elsewhere that should be modularized
# 2) option to use site-packages rather than pypi-modules
# 3) make sure to cleanup .tmp on errors.
import os, os.path, sys, urllib2, requests, tempfile, zipfile, shutil, gzip, tarfile, xmlrpclib, ConfigParser
__pypi_base__ = os.path.abspath(os.path.dirname(__file__))
@jsbain
jsbain / Add Web Tab.py
Created December 5, 2016 10:41 — forked from steventroughtonsmith/Add Web Tab.py
Insert a custom browser tab into Pythonista
# coding: utf-8
from Foundation import *
from QuartzCore import *
from UIKit import *
import console
WKWebView = ObjCClass('WKWebView')
@on_main_thread