Skip to content

Instantly share code, notes, and snippets.

View jni's full-sized avatar

Juan Nunez-Iglesias jni

View GitHub Profile
@jni
jni / save_selection.py
Created September 25, 2018 07:17
attempt to save csv of selection from bokeh plot (not working)
"""Run this example as: python save_selection.py
Then navigate to localhost:5000
Use python save_selection.py -h for more options.
"""
import base64
import pandas as pd
import numpy as np
@jni
jni / save_dataframe.py
Created September 21, 2018 08:52
Minimal example attempting to save dataframe from Bokeh selection
import pandas as pd
import numpy as np
from bokeh.server.server import Server
from bokeh.application import Application
from bokeh.application.handlers.function import FunctionHandler
from bokeh.plotting import figure
from bokeh.layouts import widgetbox, layout
from bokeh.models import ColumnDataSource
from bokeh.models.widgets import Button
@jni
jni / Chap 1 dub 2.ipynb
Created March 31, 2018 23:09 — forked from capissimo/Chap 1 dub 2
Chpater 1 from Elegant SciPy (rev 2)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jni
jni / tksyncplot.py
Created February 23, 2017 01:29
Tkinter asyncio matplotlib crash: long-running async tasks using matplotlib and launched by a tkinter GUI
import asyncio
import matplotlib
matplotlib.use('TkAgg')
import tkinter as tk
from tkinter import ttk
from skimage._shared._tempfile import temporary_file
import numpy as np
@asyncio.coroutine
@jni
jni / karabiner.json
Last active November 13, 2017 02:26
Karabiner configuration file
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
@jni
jni / programming-languages-in-ADS.ipynb
Last active July 6, 2018 04:35
Counting programming language mentions in astronomy papers
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jni
jni / parking map.ipynb
Created February 23, 2016 22:14 — forked from manugarri/parking map.ipynb
Where the f*** can I park?
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jni
jni / throughput.py
Last active September 28, 2015 08:55
Throughput of simple streaming of text data with Toolz/CyToolz
from IPython import get_ipython
import toolz as tz
from toolz import curried as c
fn = 'data/mb1_dm6.fa'
t = get_ipython().magic('timeit -o -q tz.pipe(fn, open, tz.last)')
print('Raw throughput (lines): %.2fMB/s' % (1 / t.best))
t = get_ipython().magic('timeit -o -q tz.pipe(fn, open, tz.concat, tz.last)')
print('Single character throughput: %.2fMB/s' % (1 / t.best))
def is_sequence(line):
return len(line) > 1 and not line.startswith('>')
@jni
jni / mb1_dm6.fa
Created September 28, 2015 08:20
First ~1MB of the D. melanogaster genome v6 FASTA file
This file has been truncated, but you can view the full file.
>chr2L
Cgacaatgcacgacagaggaagcagaacagatatttagattgcctctcat
tttctctcccatattatagggagaaatatgatcgcgtatgcgagagtagt
gccaacatattgtgctctttgattttttggcaacccaaaatggtggcgga
tgaaCGAGATGATAATATATTCAAGTTGCCGCTAATCAGAAATAAATTCA
TTGCAACGTTAAATACAGCACAATATATGATCGCGTATGCGAGAGTAGTG
CCAACATATTGTGCTAATGAGTGCCTCTCGTTCTCTGTCTTATATTACCG
CAAACCCAAAAAgacaatacacgacagagagagagagcagcggagatatt
tagattgcctattaaatatgatcgcgtatgcgagagtagtgccaacatat
tgtgctctCTATATAATGACTGCCTCTCATTCTGTCTTATTTTACCGCAA
### Keybase proof
I hereby claim:
* I am jni on github.
* I am jni (https://keybase.io/jni) on keybase.
* I have a public key whose fingerprint is 9917 C047 FE5D 7675 689F 03C1 E6C7 550F 653B E587
To claim this, I am signing this object: