Skip to content

Instantly share code, notes, and snippets.

@telegraphic
telegraphic / app.py
Created June 3, 2018 05:07
Example bottle.py app showing how to embed Bokeh plots that update dynamically with AJAX, using AjaxDataSource.
"""
# app.py -- Example bottle.py app showing how to embed AJAX Bokeh plots that update automatically.
"""
from bottle import *
from bokeh.plotting import figure
from bokeh.embed import components
from bokeh.resources import CDN
from bokeh.models.sources import AjaxDataSource
@jmeyers314
jmeyers314 / prof.py
Last active October 17, 2016 22:33
Manipulate and evaluate elliptical Sersic and Moffat surface brightness profiles. Also be able to analytically manipulate parameterizations of profile ellipticity and size.
# Tools to analytically manipulate ellipses and some astronomical profiles.
#
# Written by Joshua E. Meyers (2014-2015).
import numpy as np
from scipy.optimize import newton
from scipy.special import gammainc, gamma
import math
from functools import reduce
@m14t
m14t / fix_github_https_repo.sh
Created July 5, 2012 21:57
Convert HTTPS github clones to use SSH
#/bin/bash
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'`
if [ -z "$REPO_URL" ]; then
echo "-- ERROR: Could not identify Repo url."
echo " It is possible this repo is already using SSH instead of HTTPS."
exit
fi