Skip to content

Instantly share code, notes, and snippets.

View dermatologist's full-sized avatar
🔥
Playing with FHIR

Bell Eapen dermatologist

🔥
Playing with FHIR
View GitHub Profile
@dermatologist
dermatologist / dev-openfaas-env.sh
Created November 24, 2019 21:57 — forked from LucasRoesler/dev-openfaas-env.sh
Create a new dev environment using KinD and immediately forward the Gateway port
#!/bin/bash
DEVENV=${1:-devopenfaas}
kind create cluster --name "$DEVENV"
export KUBECONFIG="$(kind get kubeconfig-path --name="$DEVENV")"
kubectl rollout status deploy coredns --watch -n kube-system
# INSTALLING HELM
@dermatologist
dermatologist / docker.sh
Created November 18, 2019 22:36 — forked from monkeym4ster/docker.sh
Docker: save/load container using tgz file (tar.gz)
#for not running docker, use save:
docker save <dockernameortag> | gzip > mycontainer.tgz
#for running or paused docker, use export:
docker export <dockernameortag> | gzip > mycontainer.tgz
#load
gunzip -c mycontainer.tgz | docker load
@dermatologist
dermatologist / doit.sh
Created September 1, 2019 16:53 — forked from charlesreid1/doit.sh
Download the Large-scale CelebFaces Attributes (CelebA) Dataset from their Google Drive link
#!/bin/bash
#
# Download the Large-scale CelebFaces Attributes (CelebA) Dataset
# from their Google Drive link.
#
# CelebA: http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html
#
# Google Drive: https://drive.google.com/drive/folders/0B7EVK8r0v71pWEZsZE9oNnFzTm8
python3 get_drive_file.py 0B7EVK8r0v71pZjFTYXZWM3FlRnM celebA.zip
@dermatologist
dermatologist / Dockerfile
Created August 14, 2019 20:52 — forked from orenitamar/Dockerfile
Installing numpy, scipy, pandas and matplotlib in Alpine (Docker)
# Below are the dependencies required for installing the common combination of numpy, scipy, pandas and matplotlib
# in an Alpine based Docker image.
FROM alpine:3.4
RUN echo "http://dl-8.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
RUN apk --no-cache --update-cache add gcc gfortran python python-dev py-pip build-base wget freetype-dev libpng-dev openblas-dev
RUN ln -s /usr/include/locale.h /usr/include/xlocale.h
RUN pip install numpy scipy pandas matplotlib
@dermatologist
dermatologist / docker-compose-backup.sh
Created August 3, 2019 23:43 — forked from pirate/docker-compose-backup.sh
Backup a docker-compose project, including all images, named and unnamed volumes, container filesystems, config, logs, and databases.
#!/usr/bin/env bash
# Fully backup a docker-compose project, including all images, named and unnamed volumes, container filesystems, config, logs, and databases.
project_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )"
cd "$project_dir"
project_name=$(basename "$project_dir")
backup_time=$(date +"%Y-%m-%d_%H-%M")
backup_dir="$project_dir/data/backups/$backup_time"
// Create a Singularity image from a Docker image that is in the Docker hub
// where /tmp/ is the folder where the image will be created and ubuntu:14.04
// is the docker image used to convert to the Singularity image
docker run \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /tmp/:/output \
--privileged -t --rm \
singularityware/docker2singularity \
ubuntu:14.04
//
@dermatologist
dermatologist / NLP_Demo.py
Created February 11, 2019 01:13 — forked from narulkargunjan/NLP_Demo.py
Topic Modeling (LDA/Word2Vec) with Spacy
import os
import codecs
data_directory = os.path.join('..', 'data',
'yelp_dataset_challenge_academic_dataset')
businesses_filepath = os.path.join(data_directory,
'yelp_academic_dataset_business.json')
with codecs.open(businesses_filepath, encoding='utf_8') as f:
@dermatologist
dermatologist / camel-raw-oauth.java
Created November 5, 2018 20:51 — forked from rafaeltuelho/camel-raw-oauth.java
camel snippet using oauth to get an auth token and use it to request a secured rest service
from("timer://scheduler?period=30s")
.log("get access token")
.to("direct:authService");
from("direct:authService").tracing()
.setHeader(Exchange.HTTP_PATH)
.simple("<auth service context>/oauth2/token")
.setHeader("CamelHttpMethod")
.simple("POST")
.setHeader("Content-Type")
@dermatologist
dermatologist / gist:6a110d32b2b21eb94d819a598000566f
Created October 17, 2018 10:43 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@dermatologist
dermatologist / csvtomap.go
Created September 29, 2018 13:14 — forked from drernie/csvtomap.go
Golang Convert CSV Records to Dictionaries using Header Row as Keys
// CSVToMap takes a reader and returns an array of dictionaries, using the header row as the keys
func CSVToMap(reader io.Reader) []map[string]string {
r := csv.NewReader(reader)
rows := []map[string]string{}
var header []string
for {
record, err := r.Read()
if err == io.EOF {
break
}