Skip to content

Instantly share code, notes, and snippets.

View martinholub's full-sized avatar

Martin Holub martinholub

View GitHub Profile
@martinholub
martinholub / example.py
Last active October 7, 2020 21:44
CartPole-v0 with SARSA
import gym
import gym.spaces
gym.logger.set_level(40)
gym.__version__
dapprox = grad(approx)
discount = 1.0 # Discount rate
epsilon = 0.2 # Exploration rate
alpha = 0.1 # Step size for gradient descent
w = np.zeros((4,2)) # Initalize weigths
@martinholub
martinholub / setup.md
Last active July 14, 2018 08:02
Installing Jekyll on Linux

Setting up Jekyll on Linux

First, install Ruby and dependencies.
sudo apt-get install ruby ruby-dev build-essential

Create path for gems in your home.

echo '# Install Ruby Gems to ~/gems' >> ~/.bashrc
echo 'export GEM_HOME=$HOME/gems' >> ~/.bashrc
echo 'export PATH=$HOME/gems/bin:$PATH' >> ~/.bashrc
@martinholub
martinholub / mathjax_local.js
Created April 15, 2018 11:42
Local MathJax Extension
MathJax.Hub.Config({
jax: ["input/TeX", "output/HTML-CSS"],
tex2jax: {
inlineMath: [['$', '$']],
displayMath: [['$$', '$$'],['\\[','\\]']],
processEscapes: true,
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
},
messageStyle: "none",
"HTML-CSS": { preferredFont: "TeX", availableFonts: ["STIX","TeX"] },
@martinholub
martinholub / logger_utils.py
Last active March 30, 2018 10:27
Utils script to construct file/stdout logger for calling module
import sys
from datetime import datetime
import logging
from inspect import getmodule
def _L(skip=0):
'''Shorthand to get logger from some parent frame
Parmeters:
-----------
.header {
width: 100%;
height: 150px;
background-color: green;
}
#line {
background-color: black;
height: 40px;
}
#bio {
body {
font-family: 'Open Sans', sans-serif;
font-weight: bold;
}
.nav {
background-color: white;
text-transform: uppercase;
font-weight: bold;
font-size: 15px;
position: fixed;