A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
| #!/bin/sh | |
| # Post-commit hook for revision-awsm-ness | |
| function gettempfilename() | |
| { | |
| tempfilename=$1-$RANDOM$RANDOM.tex | |
| if [ -e $tempfilename ] | |
| then | |
| tempfilename=$(gettempfilename) |
| import astropy.units as u | |
| from astropy.coordinates import ICRSCoordinates | |
| from streams.coordinates import SgrCoordinates, OrphanCoordinates | |
| icrs = ICRSCoordinates(15.34167, 1.53412, unit=(u.hour, u.degree)) | |
| sgr = icrs.transform_to(SgrCoordinates) | |
| print(sgr.Lambda, sgr.Beta) | |
| orp = sgr.transform_to(OrphanCoordinates) | |
| print(orp.Lambda, orp.Beta) |
Roll your own iPython Notebook server with Amazon Web Services (EC2) using their Free Tier.
| import json | |
| import requests | |
| # Authentication for user filing issue (must have read/write access to | |
| # repository to add issue to) | |
| USERNAME = 'CHANGEME' | |
| PASSWORD = 'CHANGEME' | |
| # The repository to add this issue to | |
| REPO_OWNER = 'CHANGEME' |
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| #Requires python >=2.6 | |
| """ | |
| Tool to convert github issues to pull requests by attaching code. Uses the | |
| github v3 API. Defaults assumed for the `astropy <http://www.astropy.org>`_ | |
| project. | |
| """ | |
| from __future__ import print_function |
| IMPORTANT: this is outdated, go to https://github.com/netroy/Lockets | |
| "npm install socket-io" & you are ready to go |
| #!/usr/bin/env python | |
| ''' | |
| Takes a GitHub service hook POST and automatically updates the associated repo. | |
| ''' | |
| __license__ = ''' | |
| Copyright 2009 Jake Wharton | |
| hookpuller is free software: you can redistribute it and/or modify |