Skip to content

Instantly share code, notes, and snippets.

View TiO2's full-sized avatar
🎯
Precision

TiO2 TiO2

🎯
Precision
View GitHub Profile
'''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
@TiO2
TiO2 / default.conf
Created May 17, 2017 12:19
NGiNX Configuration for Vue-Router in HTML5 Mode
server {
listen 80 default_server;
listen [::]:80 default_server;
root /your/root/path;
index index.html;
server_name you.server.com;
@TiO2
TiO2 / grab_pdfs.py
Last active April 23, 2017 16:03 — forked from elssar/grab_pdfs.py
Download all the pdf files linked in a given webpage.
#!/usr/bin/env python
"""
Download all the pdfs linked on a given webpage
Usage -
python grab_pdfs.py url <path/to/directory>
url is required
path is optional. Path needs to be absolute
@TiO2
TiO2 / gist:a082562760608c06a7f5d0af0ac1ad75
Created March 9, 2017 23:49 — forked from why-not/gist:4582705
Pandas recipe. I find pandas indexing counter intuitive, perhaps my intuitions were shaped by many years in the imperative world. I am collecting some recipes to do things quickly in pandas & to jog my memory.
"""quick way to create a data frame to try things out"""
df = pd.DataFrame(np.random.randn(5, 4), columns=['a', 'b', 'c', 'd'])
df['A'] """ will bring out a col """ df.ix[0] """will bring out a row, #0 in this case"""
"""to get an array from a data frame or a series use values, note it is not a function here, so no parans ()"""
point = df_allpoints[df_allpoints['names'] == given_point] # extract one point row.
point = point['desc'].values[0] # get its descriptor in array form.
@TiO2
TiO2 / aedotplot.r
Created March 5, 2017 02:25 — forked from mabanach/aedotplot.r
Adverse Event Dotplot for R
## DEMO FOR SAFETY GRAPHICS
require(lattice)
## The following functions are in the HH package
panel.ae.dotplot <-
function (x, y, groups, ..., col.AB, pch.AB, lower, upper)
{
panel.num <- panel.number()
if (panel.num == 1)
panel.ae.leftplot(x, y, groups = groups,