Skip to content

Instantly share code, notes, and snippets.

View paulochf's full-sized avatar
⌨️

Paulo Haddad paulochf

⌨️
View GitHub Profile
@paulochf
paulochf / Preferences.sublime-settings
Last active August 29, 2015 14:05
My Sublime Text 3 editor settings
{
"always_prompt_for_file_reload": true,
"always_show_minimap_viewport": true,
"animation_enabled": true,
"atomic_save": true,
"auto_close_tags": true,
"auto_complete": true,
"auto_complete_commit_on_tab": false,
"auto_complete_delay": 50,
"auto_complete_selector": "source - comment, meta.tag - punctuation.definition.tag.begin",
@paulochf
paulochf / Workshop.ipynb
Last active August 26, 2016 13:22
Python presentation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@paulochf
paulochf / gist:80babb1e6e350b72e9ba
Last active September 2, 2016 20:40
Installing pyenv + virtualenv + Python 3.4.3 + new environment
git clone https://github.com/yyuu/pyenv.git ~/.pyenv
git clone https://github.com/yyuu/pyenv-virtualenv.git ~/.pyenv/plugins/pyenv-virtualenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bash_profile
pyenv install 3.4.3
mkvirtualenv -p `pyenv which python3` env-py343
@paulochf
paulochf / pydata_dc_2016_vi_in_python.ipynb
Created November 3, 2016 17:14 — forked from AustinRochford/pydata_dc_2016_vi_in_python.ipynb
PyData DC 2016 Variational Inference in Python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@paulochf
paulochf / dataframe_diff.py
Created April 26, 2017 20:21
Prints differences between two given DataFrame's
import numpy as np
import pandas as pd
def df_diff(df1, df2):
# Extracted from
# http://stackoverflow.com/a/17095620
diffs = df1 != df2
ne_stacked = diffs.stack()
changed = ne_stacked[ne_stacked]
@paulochf
paulochf / types_max_values_ordering.ipynb
Created November 28, 2017 19:40
Numpy types ordering regarding their maximum values
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@paulochf
paulochf / some_transformers.py
Created January 16, 2018 16:03
A label enconding transformer
from sklearn.base import BaseEstimator, TransformerMixin
class NoFitMixin:
"""Gives fit method by inheritance."""
def fit(self, X, y=None, **fit_params):
return self
class LabelFeaturizer(BaseEstimator, TransformerMixin, NoFitMixin):
@paulochf
paulochf / load.ipynb
Created February 1, 2018 20:22
Load data matrix using Numpy
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@paulochf
paulochf / mapping_street_carnival.ipynb
Last active February 12, 2018 00:38
Mapping street carnival parties
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@paulochf
paulochf / fix.sh
Created February 15, 2018 19:35
Pritunl icon in Ubuntu top task bar workaround
#!/usr/bin/env bash
# Doesn't fix the icon to have the right appearance, but stop the top bar from being ridiculously big.
cd /usr/share/pritunl_client && for f in `ls *svg`; do sudo sed -i -E -e 's/200([ "])/24\1/g' $f; done && cd -