Skip to content

Instantly share code, notes, and snippets.

View augustfly's full-sized avatar

August Muench augustfly

View GitHub Profile
@augustfly
augustfly / vao_intercom_script.py
Created April 8, 2011 17:21
notes as script on using ds9 private SAMP and public samp mtypes
# '/Users/aamn/Projects/VO_Projects/Python/Test_vaods9'
import os
import vao_intercom
ds9c = vao_intercom.ds9Com()
# find out where ds9 thinks it is
ds9c.get('cd')
@augustfly
augustfly / vao_intercom.py
Created April 8, 2011 17:17 — forked from lupalberto/vaods9.py
Gus's play on Omar's sampy code
# src: https://gist.github.com/906716/82e170c4952a75fde3fdc1e5c5f008979e1a8364
import sampy
import urlparse
mtype_lu = {}
mtype_lu['votable'] = {'mtype':'table.load.votable',
'params':['name','url','table-id']}
mtype_lu['fits_table'] = {'mtype':'table.fits.votable' ,
'params':['name','url','table-id']}
@lupalberto
lupalberto / vaods9.py
Created April 6, 2011 23:00
A Python API for ds9 using SAMP and SAMPy
import sampy
import urlparse
import os
def ds9echo(response):
print response
class Client(sampy.SAMPIntegratedClient):
def __init__(self,
@astrofrog
astrofrog / sampy_receive.py
Created March 4, 2011 20:47
Receive table.load.votable SAMP command from Python
from sampy import *
import time
import urllib
myhub=SAMPHubProxy()
myhub.connect()
client=SAMPClient(myhub)
@astrofrog
astrofrog / sampy_send.py
Created March 4, 2011 20:46
Broadcast a table from Python over SAMP
from sampy import *
import time
import urllib
myhub = SAMPHubProxy()
myhub.connect()
client = SAMPClient(myhub)
@satra
satra / 00README
Created February 26, 2011 19:40
Installing EPD 7.0 + ETS on OSX x64 + virtualenv
Please note that this gist applies to EPD version 7.0 and 7.1. EPD 7.1 includes ETS
but not completely on OSX x64. Furthermore a patch has been submitted for inclusion
in virtualenv that should resolve the virtualenv issue.
The notes below were compiled for 7.0 and will need to be replaced with corresponding
7.1 paths.
https://github.com/satra/virtualenv/tree/fix/EPDpatch

from EPD install:

As the last step, you should edit your .bashrc or prepend
the EPD install path:

    /software/python/EPD/7.0/bin

Thank you for installing EPD!

$ export PATH=/software/python/EPD/7.0/bin:$PATH

@satra
satra / EPD_virtualenv_ubuntu.rst
Created February 23, 2011 15:00
EPD for NiPyPE

from EPD install:

As the last step, you should edit your .bashrc or prepend
the EPD install path:

    /software/python/EPD/7.0/bin

Thank you for installing EPD!

$ export PATH=/software/python/EPD/7.0/bin:$PATH

@uogbuji
uogbuji / gruber_urlintext.py
Created November 18, 2010 18:28
John Gruber's regex to find URLs in plain text, converted to Python/Unicode
#See: http://daringfireball.net/2010/07/improved_regex_for_matching_urls
import re, urllib
GRUBER_URLINTEXT_PAT = re.compile(ur'(?i)\b((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'".,<>?\xab\xbb\u201c\u201d\u2018\u2019]))')
for line in urllib.urlopen("http://daringfireball.net/misc/2010/07/url-matching-regex-test-data.text"):
print [ mgroups[0] for mgroups in GRUBER_URLINTEXT_PAT.findall(line) ]