Skip to content

Instantly share code, notes, and snippets.

View DanielLSM's full-sized avatar

Daniel Marta DanielLSM

View GitHub Profile
@DanielLSM
DanielLSM / kulback_leibler_divergence.py
Created March 9, 2018 19:55 — forked from swayson/kulback_leibler_divergence.py
Numpy and scipy ways to calculate KL Divergence.
"""
Specifically, the Kullback–Leibler divergence from Q to P, denoted DKL(P‖Q), is
a measure of the information gained when one revises one's beliefs from the
prior probability distribution Q to the posterior probability distribution P. In
other words, it is the amount of information lost when Q is used to approximate
P.
"""
import numpy as np
from scipy.stats import entropy

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@DanielLSM
DanielLSM / tmux.conf
Created July 24, 2018 12:11 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@DanielLSM
DanielLSM / starttmux.sh
Created September 16, 2018 15:50 — forked from todgru/starttmux.sh
Start up tmux with custom windows, panes and applications running
#!/bin/sh
#
# Setup a work space called `work` with two windows
# first window has 3 panes.
# The first pane set at 65%, split horizontally, set to api root and running vim
# pane 2 is split at 25% and running redis-server
# pane 3 is set to api root and bash prompt.
# note: `api` aliased to `cd ~/path/to/work`
#
session="work"
@DanielLSM
DanielLSM / connect_bluetooth_headphones.sh
Created September 28, 2020 16:50 — forked from egelev/connect_bluetooth_headphones.sh
Connect bluetooth headphones on Ubuntu 18.04
#!/usr/bin/env bash
function get_headphones_index() {
echo $(pacmd list-cards | grep bluez_card -B1 | grep index | awk '{print $2}')
}
function get_headphones_mac_address() {
local temp=$(pacmd list-cards | grep bluez_card -C20 | grep 'device.string' | cut -d' ' -f 3)
temp="${temp%\"}"
temp="${temp#\"}"
@DanielLSM
DanielLSM / tmux-cheat-sheet.md
Created September 29, 2020 15:43 — forked from michaellihs/tmux-cheat-sheet.md
tmux Cheat Sheet