Skip to content

Instantly share code, notes, and snippets.

View ColdTeapot273K's full-sized avatar
🛌
<<<

Alexey C ColdTeapot273K

🛌
<<<
View GitHub Profile
@ColdTeapot273K
ColdTeapot273K / week-05-broken.ipynb
Last active April 25, 2022 22:29
stat-rethinking-week-05
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ColdTeapot273K
ColdTeapot273K / transform_colorscale.py
Created January 31, 2022 12:14
Transform Plotly colorscale into something dark-theme-friendly
import plotly.express as px
palette = px.colors.sequential.Bluered.copy()
new_palette = list()
for color in palette:
orig_color = color[4:-1].split(",")
# offset = 50
# offset = 75
offset = 100
orig_color = [np.clip(offset + int(color_elem), 0, 255) for color_elem in orig_color]
@ColdTeapot273K
ColdTeapot273K / aleksej-intheloop.zsh-theme
Last active January 18, 2022 19:07
Custom oh-my-zsh theme 2 (`intheloop` theme but with better colors). Julia colored
# A multiline prompt with username, hostname, full path, return status, git branch, git dirty status, git remote status
local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}"
local host_color="green"
# if [ -n "$SSH_CLIENT" ]; then
# local host_color="red"
# fi
# add extra styling for activated venvs
@ColdTeapot273K
ColdTeapot273K / aleksej-intheloop.zsh-theme
Created January 18, 2022 15:53
Custom oh-my-zsh theme 1 (`intheloop` theme but with better colors)
# A multiline prompt with username, hostname, full path, return status, git branch, git dirty status, git remote status
local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}"
local host_color="green"
if [ -n "$SSH_CLIENT" ]; then
local host_color="red"
fi
PROMPT='
@ColdTeapot273K
ColdTeapot273K / vw-convergence.ipynb
Last active January 4, 2023 09:16
Problem with learning from context for Vowpal Wabbit on simple data.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ColdTeapot273K
ColdTeapot273K / scipy_vs_cvxpy.py
Created January 18, 2021 22:06
Scipy optimizer doesn't properly converge
"""constrained LLSQ"""
"""scipy.minimize"""
import numpy as np
from scipy import optimize
from scipy import linalg
# Generate random problem data.
m = 30