Skip to content

Instantly share code, notes, and snippets.

@carolosf
carolosf / intro.py
Created December 11, 2018 23:22
Instructions for getting started with jupyter notebooks on python with visual studio code and code samples
# Download Anaconda https://www.anaconda.com/download/
# Anaconda is a standalone python environment that doesn't mess with your system python and comes with useful libraries pre-installed
# execute anaconda
# cd ~/Downloads
# bash Anaconda3-5.3.1-Linux-x86_64.sh
# rm Anaconda3-5.3.1-Linux-x86_64.sh
# download visual studio code and start it up
# go to extensions tab (win linux: ctrl+shift+x)
# search for and download python extension for vscode
# search for and download jupyter extension for vscode
@carolosf
carolosf / talib-example.py
Created January 4, 2019 18:06
Example of how to use ta-lib to plot some financial graphs.
#%%
# Made the following example work in python 3
# https://github.com/mellertson/talib-macd-example/blob/master/talib-macd-matplotlib-example.py
#
# To get it working do the following:
# use anaconda 3 https://www.anaconda.com/download/#linux
# if using manjaro linux install TA-lib from the package manager otherwise lookup instructions on how to install TA-lib on your system
# cd ~/anaconda3/bin; ./pip install pandas_datareader
# cd ~/anaconda3/bin; ./pip install TA-Lib
# cd ~/anaconda3/bin; ./pip install https://github.com/matplotlib/mpl_finance/archive/master.zip
@carolosf
carolosf / gist:29b83df7658ff560d7d74755a0579906
Created October 15, 2020 17:58
Install Rancher 2 server with helm using own tls certificate in terraform for airgapped installs
resource "kubernetes_namespace" "cattle-system" {
metadata {
name = "cattle-system"
}
}
resource "kubernetes_secret" "tls-ca-additional" {
metadata {
name = "tls-ca-additional"
namespace = kubernetes_namespace.cattle-system.metadata[0].name
@carolosf
carolosf / example.kt
Last active January 4, 2022 14:58
kotlin jupyter lets plot simple line and bar charts
%useLatestDescriptors
%use lets-plot
%use krangl
val m = mapOf<String,List<Int>>("x" to listOf(1,2,3), "y" to listOf(3,4,3))
val p = letsPlot(m) + theme(axisTitleX="blank")
val plot = p +
geomBar(color="#579673", stat = Stat.identity) {
x = "x"
y = "y"