Skip to content

Instantly share code, notes, and snippets.

@mcsquaredjr
mcsquaredjr / mmd_table.py
Last active June 19, 2016 05:46
Interactive multimarkdown table generator for Pythonista. Please note that multi-column spanning is not supported in this version. I need some time to think how to implement it in a sensible way. To change text alignment press on the alignment button. Generated code will be placed in the clipboard. Dr. Drang's code is used for table 'normalizati…
# Interactive multimarkdown table generator.
# 1/3/13 created
# Copyright (c) by McSquaredJr.
# Normalization code is by Dr. Drang http://goo.gl/DTphm
import cgi
import zlib
import webbrowser
import clipboard
@mcsquaredjr
mcsquaredjr / gestures.py
Last active December 10, 2015 20:49
gestures
# Detect cardinal and diagonal gestures in Pythonista scene
# 8/3/13 created
# Copyright (c) by McSquaredJr.
from scene import *
from random import random
from colorsys import hsv_to_rgb
import math
@mcsquaredjr
mcsquaredjr / everrista.py
Last active April 17, 2020 14:21
everrista
'''
Everrista: create Evernote notes with Readability and Pythonista.
'''
__author__ = 'Serge Boyko aka mcsquaredjr'
__version__ = '0.2.1'
__email__ = "serge dot boyko at gmail dot com"
# Everrista is a script written for Pythonista to create
# Evernote notes from a URL or a text copied in the clipboard with as
@mcsquaredjr
mcsquaredjr / install_google_client.py
Created March 7, 2013 16:41
install_google_client
# Simple installer script for using the google-api-client 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
# 'google-api'. In order to be able to import it, you have to add that to
# your import path, like this:
#
# import sys
# sys.path.append('google-api')
#
@mcsquaredjr
mcsquaredjr / open_recent.py
Created March 12, 2013 23:20
open_recent
'''Editor action to open recent files from the list'''
__date__ = '10-March-2013'
__author__ = 'mcsquaredjr'
__version__ = '0.1'
import os
import editor
# Length of the list
@mcsquaredjr
mcsquaredjr / install_green_cal.py
Last active December 15, 2015 04:29
install_green_cal
# Script to install greencal and required libraries
import tarfile
import shutil
import urllib
import requests
import os
import json
@mcsquaredjr
mcsquaredjr / install_gdata.py
Last active December 16, 2015 00:29
install_gdata
# Install gdata and its samples.
# To use the library add it to the system path
# Due to some issues with cElementTree implementation, please visit __init__
# in the atom directory, comment out lines 47-56 and replace with the line:
#
# from xml.etree import ElementTree
# The same operation should also be done in core.py, lines 25-34.
#
# Otherwise gdata won't work correctly.
username = 'your email'
passwd = 'your pass'
doc_name = 'PV data'
import sys
sys.path.append('../gdata')
import gdata.docs
import gdata.docs.service
import gdata.spreadsheet.service
@mcsquaredjr
mcsquaredjr / sysml_frame.py
Created September 9, 2013 16:51
sysml_frame
import Image, ImageDraw, ImageFont
import clipboard
# Simple script to create SysML frame around the image
# Define non-configurable options here
H_TEXT_OFFSET = 20
V_TEXT_OFFSET = 20
H_CUT_OUT = 20
V_CUT_OUT = 20
@mcsquaredjr
mcsquaredjr / migrateissues.py
Last active December 30, 2015 08:08
Create issues in a GitHub repo from a source defined in a Google spreadsheet. Order of the columns in the spreadsheet is not important, but those columns that will be mapped into fields **must** be named accordingly (case ignored), others columns will be ignored. You need to install gdata-python-client and gisthub3.py before trying to run the sc…
__author__ = 'Serge Boyko'
__date__ = '12/04/13'
__email__ = '[email protected]'
# Read issues from a google spreadsheet and create them in a repository
# on GitHub
# TODO:
# * add validation step to ensure GitHub won't complain about non-existing
# fields
# * add two-way synchronization