Skip to content

Instantly share code, notes, and snippets.

View cclauss's full-sized avatar

Christian Clauss cclauss

View GitHub Profile
anonymous
anonymous / Pypi.py
Created March 26, 2013 04:46
Pypi
import urllib
import tarfile
import shutil
import console
import os
class Installer(object):
name = None
version = None
firstLetter = None
@BashedCrab
BashedCrab / Hydrogen.py
Last active March 19, 2023 04:14
Hydrogen - A lightweight GUI framework for Pythonista
#
# Hydrogen is a lightweight GUI framework for Pythonista
#
# Hydrogen - https://gist.github.com/BashedCrab/5924965
#
# HydrogenLayouts - https://gist.github.com/BashedCrab/6103019
#
# HydrogenDemo - https://gist.github.com/BashedCrab/5953776
#
@BashedCrab
BashedCrab / HydrogenDemo.py
Last active March 19, 2023 04:14
Demo of the Hydrogen GUI framework for Pythonista
#
# Hydrogen is a lightweight GUI framework for Pythonista
#
# Hydrogen - https://gist.github.com/BashedCrab/5924965
#
# HydrogenLayouts - https://gist.github.com/BashedCrab/6103019
#
# HydrogenDemo - https://gist.github.com/BashedCrab/5953776
#
@Anton-2
Anton-2 / get_location.py
Created September 16, 2013 22:19
get_location
import socket
import webbrowser
import re
html = """
<!DOCTYPE html>
<html>
<head>
<script>
@Anton-2
Anton-2 / get_location.py
Created September 17, 2013 19:56
Hack used in pythonista to read the device geolocation info. This version adds some error handling, and the ability to control the geo location service options ( see http://diveintohtml5.info/geolocation.html ) The fake http protocol is very crude, it may be a better opttion to use python's BaseHTTPServer.
import socket
import webbrowser
import datetime
import json
from collections import namedtuple
class GeoLocationError(Exception):
def __init__(self, code, message):
@cclauss
cclauss / watch_pythonista_forum.py
Last active November 25, 2020 17:27
Learning how to use feedparser... recent_entries() will print out info on all posts to the Pythonista forum in the past 24 hours. watch_feed() will print out info on the last post to the Pythonista forum. Sleeps for 15 minutes then check to see if there is a newer post. If so, prints out info on it and opens its URL in the webbrowser. Repeat.
#!/usr/bin/env python
'''
recent_entries() will print out info on all posts to the Pythonista forum in the past 24 hours.
watch_feed() will print out info on the last post to the Pythonista forum.
Sleeps for 15 minutes then check to see if there is a newer post.
If so, prints out info on it and opens its URL in the webbrowser. Repeat.
'''
# -*- coding: utf-8 -*-
# Conway's game of life.
# Touch cells to give them life.
# Tap screen with two fingers to pause/un-pause.
# Tap screen with three fingers to give life to random cells.
from scene import *
from PIL import Image, ImageDraw
import random
@BashedCrab
BashedCrab / CloudJump.py
Last active July 21, 2020 03:41
CloudJump
from scene import *
import random
IMAGE_WIDTH = 101
IMAGE_HEIGHT = 171
IMAGE_Y_OFFSET = -30
BLOCK_HEIGHT = 40
BLOCK_DEPTH = 80
DEAD_ZONE_MIN = -0.02
DEAD_ZONE_MAX = 0.02
@bitoffdev
bitoffdev / filedownloader.py
Last active April 17, 2020 14:21
filedownloader.py
# Python file downloader for Pythonista by OMZ Software
# By: EJM Software ---- http://ejm.cloudvent.net
# Source: https://gist.github.com/89edf288a15fde45682a
# *****************************************
# This simple script uses the requests module to download files
# and the ui module to show a progress bar
# You can use this bookmarklet to download files from Safari:
# javascript:window.location='pythonista://filedownloader?action=run&argv='+encodeURIComponent(document.location.href);
import ui, console, clipboard, sys, requests, zipfile
@filmgirl
filmgirl / yosemite-install-usb
Last active April 3, 2018 07:04
Create Bootable USB Drive for OS X Yosemite
sudo /Applications/Install\ OS\ X\ Yosemite.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ OS\ X\ Yosemite.app --nointeraction