Skip to content

Instantly share code, notes, and snippets.

🍣
⊂(´・◡・⊂ )∘˚˳°

Jason Tam JasonTam

Block or report user

Report or block JasonTam

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View superset stuff
conda create -n superset python=3.6
conda activate superset
sudo apt-get install build-essential libssl-dev libffi-dev libsasl2-dev libldap2-dev
pip install superset
pip uninstall pandas
pip install pandas==0.23.4
pip uninstall sqlalchemy
pip install sqlalchemy==1.2
@JasonTam
JasonTam / zappa_setup
Last active May 15, 2019
zappa pipenv
View zappa_setup
pipenv --python 3.6
pipenv install
zappa init
zappa deploy
#zappa update
# fucking lambda has an old libstdc++ I think, so compile any cpython stuff with GCC/G++-5
https://archerfmy.github.io/2017/04/12/How-to-switch-your-gcc-g-version-in-ubuntu/
sudo apt-get install gcc-5 g++-5
@JasonTam
JasonTam / fix_CXXABI_1.3.9
Created May 14, 2019
CXXABI_1.3.9 deployment fixes lambda etc
View fix_CXXABI_1.3.9
(base) ➜ lib mv libstdc++.so.6 libstdc++.so.6.bak
(base) ➜ lib mv libstdc++.so libstdc++.so.bak
(base) ➜ lib ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 libstdc++.so.6
Make sure this is done in the lib of the env you are deploying with
/home/jason/anaconda3/envs/py36/lib
or
/home/jason/anaconda3/lib
View dummy_b.json
["b1", "b2", "b3", "b4", "b5", "b6"]
View dummy_a.json
["a1", "a2", "a3", "a4", "a5", "a6"]
@JasonTam
JasonTam / shap_order.ipynb
Created Nov 5, 2018
custom strftime xticks and ordering keys for shap forceplot
View shap_order.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View winners_curse.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@JasonTam
JasonTam / tf_serving.conf
Created Aug 27, 2018
example of a config file for tensorflow-serving to serve up multiple models
View tf_serving.conf
model_config_list: {
config: {
name: "bag",
base_path: "s3://.../bag_model",
model_platform: "tensorflow",
model_version_policy: {
all: {}
}
},
config: {
@JasonTam
JasonTam / spark_date_filter.scala
Created Jul 31, 2018
filter by days prior to today
View spark_date_filter.scala
val nDays = 450
df
.withColumn("date_merge", concat_ws("-", $"year", $"month", $"day"))
.withColumn("date", to_date(unix_timestamp($"date_merge", "yyyy-MM-dd").cast("timestamp")))
.drop("date_merge")
.where($"date" >= date_add(current_date(), -nDays)))
@JasonTam
JasonTam / printer_shit
Created Jun 23, 2018
brother hl-2140 printer struggles
View printer_shit
Brother HL-2140 Foomatic/hpijs-pcl5e
sudo apt-get install hpijs-ppds printer-driver-hpijs
You can’t perform that action at this time.