Open ~/.bash_profile in your favorite editor and add the following content to the bottom.
# Git branch in prompt.
parse_git_branch() {| require 'rubygems' | |
| begin require 'rspec/expectations'; rescue LoadError; require 'spec/expectations'; end | |
| require 'rack/test' | |
| require 'capybara/cucumber' | |
| # Need to override the driver to setup our proxy profile | |
| class Capybara::Driver::Selenium | |
| def self.driver | |
| unless @driver | |
| profile = Selenium::WebDriver::Firefox::Profile.new |
| import networkx as nx | |
| import matplotlib.pyplot as plt | |
| import matplotlib.image as mpimg | |
| img=mpimg.imread('/home/shobhit/Desktop/shobhit.jpg') | |
| # draw graph without images | |
| G =nx.Graph() | |
| G.add_edge(0,1,image=img,size=0.1) | |
| G.add_edge(1,2,image=img,size=0.05) | |
| G.add_edge(2,3,image=img,size=0.02) | |
| G.add_edge(3,4,image=img,size=0.075) |
| #!/usr/bin/env python | |
| import argparse | |
| import sys | |
| import jinja2 | |
| import markdown | |
| TEMPLATE = """<!DOCTYPE html> | |
| <html> |
| """ | |
| A demo of creating a new database via SQL Alchemy. | |
| Under MIT License from sprin (https://gist.github.com/sprin/5846464/) | |
| This module takes the form of a nosetest with three steps: | |
| - Set up the new database. | |
| - Create a table in the new database. | |
| - Teardown the new database. | |
| """ |
| # --------------------------------------------------------------------------- | |
| # | |
| # Description: This file holds all my BASH configurations and aliases | |
| # | |
| # Sections: | |
| # 1. Environment Configuration | |
| # 2. Make Terminal Better (remapping defaults and adding functionality) | |
| # 3. File and Folder Management | |
| # 4. Searching | |
| # 5. Process Management |
| create table oauth_client_details ( | |
| client_id VARCHAR(256) PRIMARY KEY, | |
| resource_ids VARCHAR(256), | |
| client_secret VARCHAR(256), | |
| scope VARCHAR(256), | |
| authorized_grant_types VARCHAR(256), | |
| web_server_redirect_uri VARCHAR(256), | |
| authorities VARCHAR(256), | |
| access_token_validity INTEGER, | |
| refresh_token_validity INTEGER, |
| #curl -XGET --user USERNAME:PASSWORD http://localhost:8161/api/jolokia/list | python -m json.tool | |
| # | |
| { | |
| "request": { | |
| "type": "list" | |
| }, | |
| "status": 200, | |
| "timestamp": 1420595652, | |
| "value": { | |
| "JMImplementation": { |
| package base.jms; | |
| import java.net.URI; | |
| import java.net.URISyntaxException; | |
| import org.apache.activemq.broker.BrokerService; | |
| import org.apache.activemq.broker.TransportConnector; | |
| import org.apache.activemq.usage.SystemUsage; | |
| import org.junit.rules.ExternalResource; | |
| public class ActiveMQBrokerRule extends ExternalResource { |
| * |