Skip to content

Instantly share code, notes, and snippets.

View benjaminirving's full-sized avatar

Benjamin Irving benjaminirving

View GitHub Profile
@fsausset
fsausset / keras2android.py
Created March 31, 2017 14:43
Export a Keras model to a tensorflow .pb file with embedded weights to use on Android.
from keras.models import Sequential
from keras.models import model_from_json
from keras import backend as K
import tensorflow as tf
from tensorflow.python.tools import freeze_graph
import os
# Load existing model.
with open("model.json",'r') as f:
modelJSON = f.read()
@samoshkin
samoshkin / toggle_keybindings.tmux.conf
Last active November 2, 2025 22:27
tmux.conf excerpt to toggle on/off session keybindings and prefix handling
bind -T root F12 \
set prefix None \;\
set key-table off \;\
set status-style "fg=$color_status_text,bg=$color_window_off_status_bg" \;\
set window-status-current-format "#[fg=$color_window_off_status_bg,bg=$color_window_off_status_current_bg]$separator_powerline_right#[default] #I:#W# #[fg=$color_window_off_status_current_bg,bg=$color_window_off_status_bg]$separator_powerline_right#[default]" \;\
set window-status-current-style "fg=$color_dark,bold,bg=$color_window_off_status_current_bg" \;\
if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
refresh-client -S \;\
bind -T off F12 \
@maidens
maidens / sensitivity_specificity_confidence_intervals.py
Created May 14, 2018 18:28
Confidence intervals for sensitivity and specificity in Python
from __future__ import print_function, division
from math import sqrt
from scipy.special import ndtri
def _proportion_confidence_interval(r, n, z):
"""Compute confidence interval for a proportion.
Follows notation described on pages 46--47 of [1].