This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from objc_util import * | |
import time | |
import notification | |
APP=UIApplication.sharedApplication() | |
DISPLAYMODE=0 | |
def setBadge(text): | |
APP.setApplicationBadgeString_(text) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
from objc_util import * | |
import console | |
import urllib | |
import dialogs | |
WKWebView = ObjCClass('WKWebView') | |
UIViewController = ObjCClass('UIViewController') | |
UIBarButtonItem = ObjCClass('UIBarButtonItem') | |
NSURLRequest = ObjCClass('NSURLRequest') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins { | |
id "net.minecraftforge.gradle.tweaker-server" version "2.0.2" | |
} | |
version = "1.0" | |
group= "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-conventions.html | |
archivesBaseName = "modid" | |
minecraft { | |
version = "1.8" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
'''Creates a zip archive of your Pythonista files and serves them via HTTP in your local network.''' | |
import sys | |
if sys.version_info[0] >= 3: | |
from http.server import SimpleHTTPRequestHandler, HTTPServer | |
else: | |
from SimpleHTTPServer import SimpleHTTPRequestHandler | |
from BaseHTTPServer import HTTPServer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example usage of the function: | |
# decompress('somefile.pack.lzma', 'somefile.pack') | |
# Decompresses a lzma compressed file from the first input file path to the second output file path | |
import sys | |
from ctypes import CDLL, Structure, c_void_p, c_size_t, c_uint, c_uint32, c_uint64, create_string_buffer, addressof, sizeof, byref | |
class lzma_stream(Structure): | |
_fields_ = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# FontInstaller (by @olemoritz) | |
# This script installs a custom TTF font on iOS (system-wide). | |
# It can be used in one of two ways: | |
# 1. Simply run it in Pythonista, you'll be prompted for the URL of the font | |
# you'd like to install (if there's a URL in the clipboard, it'll be used by default) | |
# 2. Use it as an 'Open in...' handler, i.e. select this file in Pythonista's 'Open in... | |
# menu' setting. This way, you can simply download a ttf file in Safari and open it in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/hex" | |
"log" | |
"net" | |
"time" | |
) | |
const ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bs4, collections, console, requests, scene | |
tkColorDict = collections.OrderedDict() # key = tkinter color name | |
def loadTkColorDict(): # will automaticly be called by getColor() if needed | |
tkColorURL = 'http://www.tcl.tk/man/tcl8.6/TkCmd/colors.htm' | |
print('Loading tkinter colors from: ' + tkColorURL) | |
tkColorSoup = bs4.BeautifulSoup(requests.get(tkColorURL).text).tbody | |
print('Soup is ready. Creating color table...') | |
for tableRow in tkColorSoup.find_all('tr'): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage of this file: | |
# This code is intended for use in the iOS python interpreter named 'Pythonista'. | |
# When looking at a page on the torrentz.eu search engine for a torrent result from Mobile Safari | |
# you can click on a bookmarklet (mentioned below) and it will cause the following: | |
# - Search results for the page are scraped | |
# - Torrent sites are visited for direct download links for the .torrent file | |
# - A .torrent file is downloaded | |
# - The .torrent file trackers are updated to include the scraped trackers listed on torrentz.eu | |
# - The .torrent file is re-uploaded to your Dropbox account (for an on-demand HTTP source) | |
# - The direct download link for the modified .torrent file is passed via RPC to a Transmission torrent server |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ply_url = 'https://pypi.python.org/packages/source/p/ply/ply-3.4.tar.gz' | |
slimit_url = 'https://pypi.python.org/packages/source/s/slimit/slimit-0.8.1.zip' | |
print 'Downloading SlimIt...' | |
from urllib import urlretrieve | |
import tarfile | |
import zipfile | |
import shutil | |
import os | |
try: |