Skip to content

Instantly share code, notes, and snippets.

@dennisobrien
dennisobrien / Markdown.JavaScript.md.js
Created October 1, 2017 04:52
DataGrip extension to export results to markdown.
/*
* DataGrip extension to export results to markdown.
* The markdown table format is supported by Github and Jira. I haven't tested others.
*
* Tested on DataGrip 2016.2.2
* - Open the File view. View -> Tool Windows -> Files
* - Activate the "Scratches" tab. You should see "Files", "Scopes", and "Scratches".
* - Copy this file to Extensions/Database Tools and SQL/data/extractors/Markdown.JavaScript.md.js
* - Run a query with some results.
* - Change the export format to Markdown.JavaScript.md.js and click "To Clipboard".
from getpass import getpass
from glob import glob
import numpy as np
import os
import sh
import shutil
def get_data_dir(*args, relative=False):
"""Return the path to the data directory.
@dennisobrien
dennisobrien / bokeh_datatable_filter_and_send.py
Last active January 12, 2020 04:55
Filter a Bokeh DataTable using multiple filter widgets and send the filtered results to the next step (in this case a blank window). Assumes the data table is not editable. Runs in a Jupyter notebook.
from bokeh.io import output_notebook
output_notebook()
from bokeh.io import show, vplot
from bokeh.models import ColumnDataSource, CustomJS
from bokeh.models.layouts import HBox
from bokeh.models.widgets import Button, DataTable, Select, Slider, TableColumn
from bokeh.sampledata.periodic_table import elements
@dennisobrien
dennisobrien / bokeh_datatable_filtered.py
Last active June 5, 2021 00:09
Filter a Bokeh DataTable using multiple filter widgets. Runs in a Jupyter notebook.
import bokeh.embed
import bokeh.io
import bokeh.models
import bokeh.models.widgets
import bokeh.plotting
import pandas as pd
from pandas_datareader import wb
bokeh.plotting.output_notebook()