Skip to content

Instantly share code, notes, and snippets.

View VinACE's full-sized avatar
💭
I may be slow to respond.

VinACE

💭
I may be slow to respond.
View GitHub Profile
@VinACE
VinACE / docker-aliases.sh
Last active May 12, 2020 11:45 — forked from jgrodziski/docker-aliases.sh
Useful Docker Aliases
############################################################################
# #
# ------- Useful Docker Aliases -------- #
# #
# # Installation : #
# copy/paste these lines into your .bashrc or .zshrc file or just #
# type the following in your current shell to try it out: #
# wget -O - https://gist.githubusercontent.com/jgrodziski/9ed4a17709baad10dbcd4530b60dfcbb/raw/d84ef1741c59e7ab07fb055a70df1830584c6c18/docker-aliases.sh | bash
# #
# # Usage: #
@VinACE
VinACE / install-tmux
Created May 15, 2019 12:42 — forked from philipsd6/install-tmux
Install tmux 2.3 on rhel/centos 7
# Install tmux on rhel/centos 7
# install deps
yum install gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
curl -OL https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz
tar -xvzf libevent-2.0.22-stable.tar.gz
cd libevent-2.0.22-stable
./configure --prefix=/usr/local
@VinACE
VinACE / nltk-intro.py
Created April 8, 2019 09:15 — forked from alexbowe/nltk-intro.py
Demonstration of extracting key phrases with NLTK in Python
import nltk
text = """The Buddha, the Godhead, resides quite as comfortably in the circuits of a digital
computer or the gears of a cycle transmission as he does at the top of a mountain
or in the petals of a flower. To think otherwise is to demean the Buddha...which is
to demean oneself."""
# Used when tokenizing words
sentence_re = r'''(?x) # set flag to allow verbose regexps
([A-Z])(\.[A-Z])+\.? # abbreviations, e.g. U.S.A.
@VinACE
VinACE / from_path_and_array.ipynb
Created November 16, 2018 12:45 — forked from elmarculino/from_path_and_array.ipynb
ImageClassifierData.from_path_and_array
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@VinACE
VinACE / docker_cheat_sheet.sh
Created June 16, 2018 05:36 — forked from victorhcm/docker_cheat_sheet.sh
(small) docker cheat sheet
#################################################################################
# Authors: Keiller Nogueira, Victor de Melo
#################################################################################
# nvidia-docker seems more stable now and several images are starting to adopt it (including
# [kaixhin](https://github.com/NVIDIA/nvidia-docker/issues/85).
# hence, we suggest to use it instead, as it solves a few issues with gpu passthrough.
# usage: it is only required when creating a container, i.e, with `run` and related arguments
# you're not required to provide $DOCKER_NVIDIA_DEVICES as it will find the devices itself
@VinACE
VinACE / classifier_from_little_data_script_3.py
Created June 11, 2018 01:30 — forked from fchollet/classifier_from_little_data_script_3.py
Fine-tuning a Keras model. Updated to the Keras 2.0 API.
'''This script goes along the blog post
"Building powerful image classification models using very little data"
from blog.keras.io.
It uses data that can be downloaded at:
https://www.kaggle.com/c/dogs-vs-cats/data
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
- created cats/ and dogs/ subfolders inside train/ and validation/
- put the cat pictures index 0-999 in data/train/cats
'''This script goes along the blog post
"Building powerful image classification models using very little data"
from blog.keras.io.
It uses data that can be downloaded at:
https://www.kaggle.com/c/dogs-vs-cats/data
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
- created cats/ and dogs/ subfolders inside train/ and validation/
- put the cat pictures index 0-999 in data/train/cats
'''This script goes along the blog post
"Building powerful image classification models using very little data"
from blog.keras.io.
It uses data that can be downloaded at:
https://www.kaggle.com/c/dogs-vs-cats/data
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
- created cats/ and dogs/ subfolders inside train/ and validation/
- put the cat pictures index 0-999 in data/train/cats
@VinACE
VinACE / useful_pandas_snippets.py
Last active September 3, 2018 06:38 — forked from bsweger/useful_pandas_snippets.md
Useful Pandas Snippets
# multiply/divide
df['quantity'] = df['quantity'].apply(lambda x: x*-1)
# round function on dataframe
df['quantity'] = df['quantity'].apply(lambda x: round(x, 2))
# List unique values in a DataFrame column
# h/t @makmanalp for the updated syntax!
df['Column Name'].unique()
@VinACE
VinACE / csv_to_elastic_search_bulk_insert.py
Created November 2, 2017 15:16 — forked from clemsos/csv_to_elastic_search_bulk_insert.py
Elastic Search : index large csv files with Python Pandas
from pyelasticsearch import ElasticSearch
import pandas as pd
from time import time
root_path="/home/clemsos/Dev/mitras/"
raw_data_path=root_path+"data/"
csv_filename="week10.csv"
t0=time()