Skip to content

Instantly share code, notes, and snippets.

@blepfo
blepfo / diff_json.js
Last active October 7, 2019 22:45
Simple utility to print difference between JSON files
/* Print out differences between two JSON files
*/
'use strict'
const _ = require('lodash');
const path = require('path');
/**
* Print out all differences between two objects
@blepfo
blepfo / TensorFlow-Best-Practices-Q1-2018.md
Last active December 13, 2018 10:22
TensorFlow Best Practices as of Q1 2018

TensorFlow Best Practices as of Q1 2018

By Adam Anderson

adam.b.anderson.96@gmail.com

Preface

This write-up assumes you have an general understanding of the TensorFlow programming model, but maybe you haven't kept up to date with the latest library features/standard practices.

@blepfo
blepfo / Python_Logging.md
Last active August 2, 2017 20:52
Quick-start guide for using the logging Module in Python

Logging in Python 2.7

This Gist summarizes some information about using the logging module in Python 2.7. The examples here are taken from the references.

The logging module makes it easy to track what's going on in your code in a more graceful way than just putting print statements during debugging. What we can do with the logging module is create handlers which will be responsible for sending log messages to a particular destination (a file, the terminal, etc).

logging can report information at multiple levels:

Singularity Info

![Virtual machine architecture][virtual_machine]

![Container architecture][container]

References

  1. [Containers 101: Linux Containers and Docker Explained][1]
  2. [Architecting Containers][2]
@blepfo
blepfo / Sphinx_Napoleon_Python_Tutorial.md
Last active June 5, 2017 20:11
Quick guide to generating HTML webpages to display documentation for your Python project based on docstrings written in the Google style.

Using Sphinx to Document Python Projects with Google Doctrings

  1. Make sure you have installed all dependencies used by the project. This is easily accomplished with pip install <module_name>

  2. See First Steps with Sphinx for an overview on how Sphinx works. Essentially, Sphinx uses a markup language called reStructuredText to create nice looking documentation. It will be helpful to read about the function of the master document index.rst so that you can understand how the toctree works.

  3. Install Sphinx with pip install sphinx

  4. To get Sphinx setup, sphinx-quickstart. This will ask several questions about the project. To make the file tree cleaner, I think it's good to separate the respond to Separate source and build directories (y/n) with y. Sphinx's Autodoc extension automatically generates the reStructuredText needed for Sphinx to build the documentation from docstrings, so

@blepfo
blepfo / TensorFlow_Notes.md
Last active October 2, 2018 17:21
TensorFlow Notes

TensorFlow Notes

By Adam Anderson

adam.b.anderson.96@gmail.com

Aggregated links to tutorials with some summaries. Like all of my Gist notes, this document is mostly so I can keep track of useful resources.

Table of Contents

Intro to Advanced Python

By Adam Anderson

adam.b.anderson.96@gmail.com

These notes are mostly just summaries of the provided references. The purpose of this document is to centralize the resources I found useful so they would be easy to find. Most definitions and explanations are paraphrased or quoted directly from the sources.

Table of Contents