Skip to content

Instantly share code, notes, and snippets.

@lschwetlick
lschwetlick / LineUpDown.ahk
Last active June 20, 2017 21:07
MATLAB Hotkeys
; Hotkeys for MATLAB and others
#SingleInstance force
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
; Changes the tray icon's tooltip (displayed when mouse hovers over it)
Menu, tray, Tip, MATLAB hotkeys (and others)
; Show Tooltip in the tray that the script is active
TrayTip, MATLAB hotkeys, running...,,1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lschwetlick
lschwetlick / bash_profile
Last active August 2, 2019 15:00
Custom Bash Prompt
NOCOLOR="\[\033[0;0m\]"
BLUE="\[\033[1;35m\]"
RED="\[\033[1;31m\]"
YELLOW="\[\033[1;33m\]"
# Setting PATH for Python 3.6
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.6/bin:${PATH}"
@lschwetlick
lschwetlick / sk1.ipynb
Last active February 28, 2020 17:19
Scikit-learn problem with PCA
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lschwetlick
lschwetlick / reciprobit.R
Created January 6, 2021 17:20
How to generate a reciprobit plot (used in LATER models) in R
# We want to generate a reciprobit plot like it is used in the context of LATER models.
# Here, we generate normally distributed data. In the reciprobit plot that should appear linear
rm(list=ls())
library(ggplot2)
N = 1000
f = rnorm(N,mean=300,sd=50)
x = sort(1/f,decreasing=T)
y = (1:N)/N
@lschwetlick
lschwetlick / multiexplode2.ipynb
Last active September 15, 2021 20:52
Multi-Column Explode idea
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lschwetlick
lschwetlick / colors2cmap.py
Created March 17, 2021 15:24
New matplotlib cmap from color list
import matplotlib.colors
def colors2cmap(*args, name=None):
"""Create a colormap from a list of given colors.
Parameters:
*args: Arbitrary number of colors (Named color, HEX or RGB).
name (str): Name with which the colormap is registered.
Returns:
@lschwetlick
lschwetlick / music_theory.py
Created April 23, 2021 10:54 — forked from mvanga/music_theory.py
Basic Music Theory in ~200 Lines of Python
# The code for my article with the same name. You can find it at the URL below:
# https://www.mvanga.com/blog/basic-music-theory-in-200-lines-of-python
# MIT License
#
# Copyright (c) 2021 Manohar Vanga
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
@lschwetlick
lschwetlick / get_gallery.py
Created July 23, 2021 06:41
Download all Images from Flickr Gallery
@lschwetlick
lschwetlick / A Script to Download Music from a Telegram Conversation
Last active January 13, 2022 13:26
Download Music from a Telegram Conversation
Download Music from a Telegram Conversation
- youtube-dl lives here https://github.com/ytdl-org
- telegram data can be downloaded in the desktop app via preferences -> advanced -> export