Skip to content

Instantly share code, notes, and snippets.

View totucuong's full-sized avatar

To Tu Cuong totucuong

View GitHub Profile
@totucuong
totucuong / README.md
Created September 7, 2020 15:19 — forked from jfreels/README.md
d3js: Create an HTML table using d3.js and JSON

d3js: Create an HTML table using d3.js and JSON

@totucuong
totucuong / selecting_rows.py
Created August 27, 2020 08:47 — forked from treuille/selecting_rows.py
Workaround: Selecting rows from a dataframe.
import streamlit as st
import pandas as pd
# Load some example data.
DATA_URL = \
"http://s3-us-west-2.amazonaws.com/streamlit-demo-data/uber-raw-data-sep14.csv.gz"
data = st.cache(pd.read_csv)(DATA_URL, nrows=1000)
# Select some rows using st.multiselect. This will break down when you have >1000 rows.
st.write('### Full Dataset', data)
@totucuong
totucuong / postgres-brew.md
Created April 22, 2020 14:50 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@totucuong
totucuong / postgres-brew.md
Created April 22, 2020 14:50 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@totucuong
totucuong / iterm2-solarized.md
Created November 21, 2019 03:37 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@totucuong
totucuong / System Design.md
Created November 13, 2019 21:52 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@totucuong
totucuong / git-annex-gcs.sh
Created September 17, 2019 09:06 — forked from jterrace/git-annex-gcs.sh
An example of how to use Google Cloud Storage with git-annex
# Initialize git and git-annex
$ mkdir annex-gcs-test
$ cd annex-gcs-test/
$ git init
Initialized empty Git repository in /Users/jterrace/annex-gcs-test/.git/
$ git annex init "my machine"
init my machine ok
(Recording state in git...)
# Set up AWS credentials
@totucuong
totucuong / report_every_callback.py
Last active September 4, 2019 08:48
Customized Keras callback
class ReportEvery(Callback):
def __init__(self, report_every=10):
super(Callback, self).__init__()
self.report_every = report_every
def on_epoch_end(self, epoch, logs={}):
if (epoch % self.report_every == 0):
loss = logs['loss']
print(f'Epoch: {epoch} - loss {loss}')
@totucuong
totucuong / generate_unique_name_tf_graph.py
Created March 26, 2019 09:41
how to generate an unique name within a given tensorflow
name = 'mymul'
g = tf.get_default_graph()
g.unique_name(name) # return 'mymul'
g.unique_name(name_ # return 'mymul_1'