Run with Python:
pip-2.7 install cffi PYTHON=python2.7 sh go.sh
Run with PyPy:
pip-pypy install cffi PYTHON=pypy sh go.sh
| sudo xcodebuild -license | |
| xcode-select --install # There will be a GUI prompt | |
| sudo cpan SVN::Core # use the "sudo" method when prompted | |
| # Then add this to your ~/.profile: | |
| # export PATH=/Library/Developer/CommandLineTools/usr/bin:$PATH | |
| # Then probably: | |
| brew reinstall git | |
| brew reinstall subversion |
Run with Python:
pip-2.7 install cffi PYTHON=python2.7 sh go.sh
Run with PyPy:
pip-pypy install cffi PYTHON=pypy sh go.sh
| // ==UserScript== | |
| // @name Draft Typekitizer | |
| // @namespace http://tyler.menez.es/ | |
| // @version 1 | |
| // @description Adds Typekit to Draft | |
| // @match http*://*.draftin.com/* | |
| // @copyright 2013 Tyler Menezes | |
| // ==/UserScript== | |
| (function() { |
| def get_count(q): | |
| count_q = q.statement.with_only_columns([func.count()]).order_by(None) | |
| count = q.session.execute(count_q).scalar() | |
| return count | |
| q = session.query(TestModel).filter(...).order_by(...) | |
| # Slow: SELECT COUNT(*) FROM (SELECT ... FROM TestModel WHERE ...) ... | |
| print q.count() |
| The regex patterns in this gist are intended only to match web URLs -- http, | |
| https, and naked domains like "example.com". For a pattern that attempts to | |
| match all URLs, regardless of protocol, see: https://gist.github.com/gruber/249502 | |
| License: https://opensource.org/license/bsd-3-clause | |
| # Single-line version: | |
| (?i)\b((?:https?:(?:/{1,3}|[a-z0-9%])|[a-z0-9.\-]+[.](?:com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps |
| from astropy.coordinates import ICRS, Galactic, Distance, Angle | |
| from astropy import units as u | |
| import math as mt | |
| import numpy as np | |
| from astropy.table import Table, Column | |
| # inspired by | |
| #http://idl-moustakas.googlecode.com/svn-history/r560/trunk/impro/hiiregions/im_hiiregion_deproject.pro | |
| def correct_rgc(coord, glx_ctr=ICRS('00h42m44.33s +41d16m07.5s'), glx_PA=Angle('37d42m54s'), glx_incl=Angle('77.5d'), glx_dist=Distance(783,unit=u.kpc)): | |
| '''computes deprojected galactocentric distance for an object at coord, |
First time:
python setup.py register
Uploading a new version:
python setup.py check
| /* | |
| Minimal Facebook Messenger | |
| ========================== | |
| 1. Make a Fluid (http://fluidapp.com/) instance of https://facebook.com/messages/ | |
| 1. a. (You need to buy the paid version of Fluid to modify UserStyles) | |
| 2. Apply the below CSS as a Userstyles stylesheet | |
| 3. Like magic, you can now message without all the cruft of Full Facebook | |
| from astropy.table import Table, Column, join, vstack | |
| from uncertainties import ufloat | |
| import astropy.units as u | |
| def uncert_str(tab_row, col_name, value_fmt): | |
| ''' format tab_row[col_name] single table row in LaTeX $num \pm unc$ format | |
| input: tab_row: single row from an astropy table | |
| col_name: name of column to be extracted and formatted | |
| value_fmt: format for string output | |
| output: |
| { | |
| "Comment": "A new CNAME for jsick's Read the Docs documentation.", | |
| "Changes": [ | |
| { | |
| "Action": "CREATE", | |
| "ResourceRecordSet": { | |
| "Name": "docs.lsst.codes.", | |
| "Type": "CNAME", | |
| "SetIdentifier" : "Read the Docs", | |
| "Weight": 10, |