View postgres-make-concepts.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file makes tables for the concepts in this subfolder. | |
# Be sure to run postgres-functions.sql first, as the concepts rely on those function definitions. | |
# Note that this may take a large amount of time and hard drive space. | |
# string replacements are necessary for some queries | |
export REGEX_DATETIME_DIFF="s/DATETIME_DIFF\((.+?),\s?(.+?),\s?(DAY|MINUTE|SECOND|HOUR|YEAR)\)/DATETIME_DIFF(\1, \2, '\3')/g" | |
export REGEX_SCHEMA='s/`physionet-data.(mimic_derived|mimic_core|mimic_hosp|mimic_icu).(.+?)`/\2/g' | |
export CONNSTR='mimiciv mimic' | |
# this is set as the search_path variable for psql |
View postgres-functions.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Functions TODO: | |
-- FROM table CROSS JOIN UNNEST(table.column) AS col -> ???? (see icustay-hours) | |
-- ???(column) -> PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY column) (not sure how to do median in BQ) | |
-- psql 'dbname=mimiciv user=mimic options=--search_path=public,mimic_core,mimic_hosp,mimic_icu,mimic_derived' -f postgres-functions.sql | |
DROP FUNCTION IF EXISTS REGEXP_EXTRACT(str TEXT, pattern TEXT); | |
CREATE OR REPLACE FUNCTION REGEXP_EXTRACT(str TEXT, pattern TEXT) RETURNS TEXT AS $$ | |
BEGIN | |
RETURN substring(str from pattern); |
View environment.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
channels: | |
- defaults | |
- pytorch | |
- fastai | |
dependencies: | |
- pip | |
- ipykernel | |
- pytorch::pytorch | |
- pytorch::torchvision | |
- tensorflow-gpu |
View unzip_into_dir.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
find ${1:-.} -name '*.zip' | sed 's/.zip//' | xargs -n1 -P $(nproc) -I _ unzip _.zip -d _ |
View bigquery_tutorial_updated.Rmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
output: html_document | |
editor_options: | |
chunk_output_type: inline | |
--- | |
Copyright 2018 Google Inc. | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at |
View iterm_bar_color.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# auto match window title and tab background color with | |
# terminal background color for iTerm2 | |
# append to your .bashrc, .zshrc or whatever | |
# does not really work with High Sierra | |
# to reset: | |
# echo -e "\033]6;1;bg;*;default\a" | |
osascript -e \ |
View keras_tf_limit_gpu.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
from keras.backend.tensorflow_backend import set_session | |
gpu_options = tf.GPUOptions(allow_growth=True, per_process_gpu_memory_fraction=0.333) | |
sess = tf.Session(config=tf.ConfigProto(gpu_options=gpu_options)) | |
set_session(sess) |
View compile_pytorch.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CC=gcc-5 CXX=g++-5 NCCL_ROOT_DIR=/opt/cuda CFLAGS="${CFLAGS/-fno-plt/}" CXXFLAGS="${CXXFLAGS/-fno-plt/}" python setup.py bdist_wheel |
View vlc_stream_browser_control.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
vlc <filename> \ | |
-I http --http-host 0.0.0.0 --http-port 4857 --http-password <password> | |
--sout '#standard{access=http,mux=ts,dst=:4875}' |
NewerOlder