This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Change prefix key to ` | |
unbind C-b | |
set -g prefix ` | |
bind-key ` send-prefix | |
bind-key C-a set-option -g prefix C-a | |
bind-key C-b set-option -g prefix ` | |
# we might need ` at some point, allow switching | |
bind-key C-a set-option -g prefix C-a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Better Logging Format | |
## Author : Dheepak Krishnamurthy | |
## License : MIT | |
logger.setLevel(logging.DEBUG) | |
ch = logging.StreamHandler() | |
ch.setLevel(logging.DEBUG) | |
# create formatter and add it to the handlers | |
formatter = logging.Formatter('%(asctime)s - [%(module)s(%(lineno)d)] - "%(name)s".%(levelname)s - %(message)s', "%Y-%m-%d %H:%M:%S") | |
ch.setFormatter(formatter) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from IPython.display import HTML | |
HTML('''<script> | |
code_show=true; | |
function code_toggle() { | |
if (code_show){ | |
$('div.input').hide(); | |
} else { | |
$('div.input').show(); | |
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-ChildItem HKLM:\Software\Classes -ErrorAction SilentlyContinue | Where-Object { | |
$_.PSChildName -match '^\w+\.\w+$' -and (Test-Path -Path "$($_.PSPath)\CLSID") | |
} | Select-Object -ExpandProperty PSChildName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .bashrc | |
# Source global definitions | |
if [ -f /etc/bashrc ]; then | |
. /etc/bashrc | |
fi | |
# set -o errexit | |
# set -o pipefail | |
# set -o nounset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def __repr__(self): | |
return '<%s.%s object at %s>' % ( | |
self.__class__.__module__, | |
self.__class__.__name__, | |
hex(id(self)) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author : Dheepak Krishnamurthy | |
# License : BSD 3 Clause | |
# Title : Custom HoverTool for linked hover tooltips | |
# Based on example from Bokeh Docs | |
from bokeh.io import output_notebook, show | |
from bokeh.layouts import gridplot | |
from bokeh.models import ColumnDataSource | |
from bokeh.plotting import figure | |
from bokeh.models import HoverTool, CustomJS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import absolute_import, division, print_function, unicode_literals | |
from builtins import (bytes, str, open, super, range, zip, round, input, int, pow) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import inspect | |
def kwargs2args(f): | |
argspec = inspect.getargspec(f) | |
no_arg_only = len(argspec.defaults) - len(argspec.args) | |
defaults = { argspec.args[no_arg_only+i]: d for i, d in enumerate(argspec.defaults)} | |
def function(*args, **kwargs): | |
old_args = list(argspec.args) | |
new_args = list() |