Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View enricorotundo's full-sized avatar
🤔
Thinking

Enrico Rotundo enricorotundo

🤔
Thinking
View GitHub Profile
@enricorotundo
enricorotundo / global.js
Created November 18, 2014 02:44
Protractor issue #1511
'use strict';
(function () {
var Global = function () {
// GETTER elements: navbar
/**
* @return {[ElementFinder]} [Returns the regisration button located in the navbar]
#!/bin/bash
#<nellyk89@gmail.com>
# http://dummyimage.com/600x400/000/fff&text=100000
BASE_URL="http://dummyimage.com/"
DEFAULT_SIZE="600X400"
DEFAULT_BG_COLOR="000"
DEFAULT_COLOR="fff"
START=1001
END=4000
@enricorotundo
enricorotundo / stackoverflow.sql
Last active November 12, 2022 16:57 — forked from gousiosg/stackoverflow.sql
Script to import the stackexchange dumps into MySQL
# Copyright (c) 2013 Georgios Gousios
# MIT-licensed
# [tundo91]
# * Edited to import local XML files
# * Updated creat table procedures to support Sept.-12-2016 dataset dump version
create database cooking_stackexchange_com DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
use cooking_stackexchange_com;
@enricorotundo
enricorotundo / .condarc
Last active September 14, 2018 09:20
Conda configuration file to support automatic kernel discovery. Note: miniconda3 is default miniconda dir on macOS, edit that path according to your conda installation.
create_default_packages:
- pip
- ipykernel
- pyopenssl
envs_dirs:
- $HOME/miniconda3/envs
@enricorotundo
enricorotundo / install_jupyter_complete.sh
Last active September 14, 2018 09:25
Install JupyterLab with extensions and automatic kernel discovery
#!/usr/bin/env bash
# Setup conda config
wget https://gist.githubusercontent.com/enricorotundo/65218b399bc7bb1c749e2f5cfd571434/raw/e6dc4e80f7894c544b43621d849555233e484f91/.condarc
cp .condarc $HOME/.condarc
# Install Jupyter and JupyterLab
conda install -c conda-forge -y jupyter ipywidgets ipykernel jupyterlab
# Enable extensions
@enricorotundo
enricorotundo / run_jupyterlab.sh
Created September 14, 2018 08:56
Run JupyterLab, token authentication off
#!/usr/bin/env bash
jupyter lab --ip=* --port=8888 --no-browser --notebook-dir=$HOME --allow-root --NotebookApp.token=''
@enricorotundo
enricorotundo / run_jupyterlab.sh
Created September 14, 2018 08:56
Run JupyterLab, token authentication off
#!/usr/bin/env bash
jupyter lab --ip=* --port=8888 --no-browser --notebook-dir=$HOME --allow-root --NotebookApp.token=''
@enricorotundo
enricorotundo / export_inference_graph_unfrozen.py
Last active October 15, 2018 13:28
Export a checkpointed object_detection model for serving with TensorFlow Serving (works with Tensorflow 1.10)
"""
Run this with
cd research/object_detection
python export_inference_graph_unfrozen.py --input_type encoded_image_string_tensor --pipeline_config_path samples/configs/ssd_mobilenet_v1_coco.config --trained_checkpoint_prefix ssd_mobilenet_v1_coco_2017_11_17/model.ckpt --output_directory /Users/erotundo/HAL24K/Projects/dockerfiles-tf-serving/ssd_mobilenet_v1_coco/models
Make sure you add object_detection in PYTHONPATH
Credits to original gist by @dnlglsn:
https://gist.github.com/dnlglsn/c42fbe71b448a11cd72041c5fcc08092
References:
@enricorotundo
enricorotundo / pymongo_connect.py
Last active June 24, 2019 09:39
Pymongo connection with a pinch of flavour
import os
import urllib
from pymongo import MongoClient
def get_conn_string() -> str:
conn_string = "mongodb://{}:{}@{}/{}".format(
os.getenv("DB_USER"),
urllib.parse.quote(os.getenv("DB_PWD")), # escapes invalid chars
os.getenv("DB_URI"),
@enricorotundo
enricorotundo / ec2.md
Created March 4, 2022 15:54
AWS EC2 notes
alias ll='ls -alF'