Skip to content

Instantly share code, notes, and snippets.

@mcsquaredjr
mcsquaredjr / google_spreadsheet.py
Created August 6, 2014 15:53
Simple wrapper around Google GData API. Caveat: columns cannot have spaces in their name. Make sure that gdata is installed before using it, to install go https://code.google.com/p/gdata-python-client/
USERNAME = 'your user name here'
PASSWD = 'your password here'
DOC_NAME = 'Document Name'
import sys
import gdata.docs
import gdata.docs.client
import gdata.docs.data
@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__ = 'serge.boyko@gmail.com'
# 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
@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
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 / 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.
@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 / 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_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 / 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 / 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