Skip to content

Instantly share code, notes, and snippets.

View TutorialDoctor's full-sized avatar

RaphaelSmith TutorialDoctor

View GitHub Profile
@jsbain
jsbain / editor_buttons.py
Created January 1, 2018 15:42
editor_buttons.py
import sys,os
# if you place objc_hacks in site packages, this line is not needed
sys.path.append(os.path.expanduser('~/Documents'))
from objc_hacks import apphack
#alternatively, just place apphack.py in site_packages, and import apphack
#little workaround to persistent button locations. needs fixing in apphack
if hasattr(apphack,'__persistent_views'):
__builtins__.__persistent_views=apphack.__persistent_views
abandoned
able
absolute
adorable
adventurous
academic
acceptable
acclaimed
accomplished
accurate
@kylehounslow
kylehounslow / client.py
Last active April 23, 2024 10:58
Send and receive images using Flask, Numpy and OpenCV
from __future__ import print_function
import requests
import json
import cv2
addr = 'http://localhost:5000'
test_url = addr + '/api/test'
# prepare headers for http request
content_type = 'image/jpeg'
@scrapehero
scrapehero / zillow.py
Last active December 13, 2023 16:05
Python 3 script to find real estate listings of properties up for sale on zillow.com
from lxml import html
import requests
import unicodecsv as csv
import argparse
import json
def clean(text):
if text:
return ' '.join(' '.join(text).split())
@jsbain
jsbain / bezier_draw.py
Last active June 26, 2017 21:07
bezier_draw.py
# a simple bezier drawing program
# divide into interface (taps), drawing code, callbacks
# ui:
# top menu
#.
# drawing code:
# single tap, add a point
# tap + drag => addoint then create and drag locked handle
# dragging existing control point or point. move ''
#. tap an existing point:show handles
@Phuket2
Phuket2 / themes_icon_view.py
Created July 29, 2016 19:08
themes_icon_view.py
'''
Pythonista Forum - @Phuket2
'''
import ui, editor, bz2, base64
#_pyui_file_name = 'booking.pyui'
__pyui_str__ ='''
QlpoOTFBWSZTWaO7pcYAGNlf4NVVUGd/9T/n3Y6/79/+IAAAQMAAYAv/A+B25OipHWmzGq
VFrRVbpiUohIELwkkp6I0jTxJ6QaABoDR6jeoE00AAABJQTBNNNNRU/UAmAAAAAAAABw0e
@Phuket2
Phuket2 / std_table_view.py
Created July 1, 2016 16:42
std_table_view.py
import ui
_colors = ['teal', 'deeppink', 'orange', 'blue', 'red']
class CustomTableViewCell(ui.View):
'''
some magic from @JonB see...
https://forum.omz-software.com/topic/3297/ui-tableviewcell-returning-a-custom-class-instead/4
'''
def as_cell(self):
@jsbain
jsbain / customtableviewcell.py
Created June 30, 2016 20:25
customtableviewcell.py
import ui
class CustomTableViewCell(ui.View):
def as_cell(self):
c=ui.TableViewCell()
self.frame=c.content_view.bounds
self.flex='wh'
c.content_view.add_subview(self)
c.set_needs_display()

Making Your Own Blog

This tutorial will walk you through making your own blog. To build it, we're going to use the Ruby programming language and a web library for it called Sinatra.

Getting started

Before we start we need to install a couple of tools. Ruby is an "interpreted" programming language, so we'll install a special program called an interpreter that will run your Ruby code. The installer also includes some other tools that help you out when building Ruby programs.

Hello World!

@omz
omz / Add Web Tab.py
Last active December 3, 2023 23:33 — forked from steventroughtonsmith/Add Web Tab.py
Insert a custom browser tab into Pythonista
# 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')