Skip to content

Instantly share code, notes, and snippets.

Micha Gorelick mynameisfiber

Block or report user

Report or block mynameisfiber

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mynameisfiber
mynameisfiber / slack-term-teams
Created Nov 5, 2018
Launch slack-term for multiple teans in a tmux session
View slack-term-teams
#!/bin/bash
_TMUX_NAME="slackterm"
function _startSlack() {
i=0
for config in $( ls ~/.slack-term/*.json ); do
if [[ "$i" -eq "0" ]]; then
TMUX="tmux new-session -d -s ${_TMUX_NAME}"
else
@mynameisfiber
mynameisfiber / word2vec_lookup.py
Created Jan 9, 2018
h5py file cache for word2vec model
View word2vec_lookup.py
import h5py
import os
import pickle
try:
import gensim
except ImportError:
gensim = None
@mynameisfiber
mynameisfiber / numpyqueue.py
Last active Aug 10, 2017
Numpy optimized multiprocessing queue
View numpyqueue.py
"""
Numpy-optimized multiprocessing queue object.
$ python numpyqueue.py
Array shape: 2
mp.queue: 0.4327036259928718
numpyqueue: 0.53742205198796
numpyqueue2: 0.5157967879931675
Array shape: 128
mp.queue: 1.7091998109972337
@mynameisfiber
mynameisfiber / mutually_exclusive_list_list_intervals.py
Last active Jun 23, 2017
Solve for the largest number of lists of intervals such that no intervals intersect.
View mutually_exclusive_list_list_intervals.py
from operator import itemgetter
def area(items):
return len(items) * sum(i[1] - i[0] for i in items)
def mutually_exclusive_list_list_intervals(data):
"""
Data is list of lists of intervals. We'd like to keep the most number of
View keybase.md

Keybase proof

I hereby claim:

  • I am mynameisfiber on github.
  • I am mynameisfiber (https://keybase.io/mynameisfiber) on keybase.
  • I have a public key ASBkDfJJ05VdHc03nmm0n4gbzRLER35ToQa0Szku72m3bQo

To claim this, I am signing this object:

View fasttest_lime.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View IRIS.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mynameisfiber
mynameisfiber / cnn_poll_data.py
Created Nov 9, 2016
Load CNN exit poll data from 2016 election into a dataframe
View cnn_poll_data.py
import pandas as pd
import ujson as json
def pct_to_int(pct):
try:
return int(pct)
except ValueError:
return 0
@mynameisfiber
mynameisfiber / ingress_codes.py
Created Jul 29, 2016
Extract ingress codes from the blog
View ingress_codes.py
from lxml import html
import requests
import re
import pickle
def get_codes(dom):
codes = set()
codes.update(_get_codes_urls(dom))
codes.update(_get_codes_alt_id(dom))
View all_exercises.py
from lxml import html
import requests
import ujson as json
from tqdm import tqdm
from urllib.parse import urljoin
import re
import string
You can’t perform that action at this time.