Skip to content

Instantly share code, notes, and snippets.

View endolith's full-sized avatar
😑

endolith

😑
View GitHub Profile
@FedeMiorelli
FedeMiorelli / turbo_colormap_mpl.py
Last active March 31, 2023 02:45
Turbo Colormap for Matplotlib
# -*- coding: utf-8 -*-
"""
Created on 2019-08-22 09:37:36
@author: fmiorell
"""
# This script registers the "turbo" colormap to matplotlib, and the reversed version as "turbo_r"
# Reference: https://ai.googleblog.com/2019/08/turbo-improved-rainbow-colormap-for.html
# License: Apache 2.0
# A straightforward translation of the Python code:
turbo_colormap_data <- matrix(
c(
c(0.18995, 0.07176, 0.23217),
c(0.19483, 0.08339, 0.26149),
c(0.19956, 0.09498, 0.29024),
c(0.20415, 0.10652, 0.31844),
@mikhailov-work
mikhailov-work / turbo_colormap.py
Created August 8, 2019 23:31
Turbo Colormap Look-up Table
# Copyright 2019 Google LLC.
# SPDX-License-Identifier: Apache-2.0
# Author: Anton Mikhailov
turbo_colormap_data = [[0.18995,0.07176,0.23217],[0.19483,0.08339,0.26149],[0.19956,0.09498,0.29024],[0.20415,0.10652,0.31844],[0.20860,0.11802,0.34607],[0.21291,0.12947,0.37314],[0.21708,0.14087,0.39964],[0.22111,0.15223,0.42558],[0.22500,0.16354,0.45096],[0.22875,0.17481,0.47578],[0.23236,0.18603,0.50004],[0.23582,0.19720,0.52373],[0.23915,0.20833,0.54686],[0.24234,0.21941,0.56942],[0.24539,0.23044,0.59142],[0.24830,0.24143,0.61286],[0.25107,0.25237,0.63374],[0.25369,0.26327,0.65406],[0.25618,0.27412,0.67381],[0.25853,0.28492,0.69300],[0.26074,0.29568,0.71162],[0.26280,0.30639,0.72968],[0.26473,0.31706,0.74718],[0.26652,0.32768,0.76412],[0.26816,0.33825,0.78050],[0.26967,0.34878,0.79631],[0.27103,0.35926,0.81156],[0.27226,0.36970,0.82624],[0.27334,0.38008,0.84037],[0.27429,0.39043,0.85393],[0.27509,0.40072,0.86692],[0.27576,0.41097,0.87936],[0.27628,0.42118,0.89123],[0.27667,0.43134,0.90254],[0.27691,0.44145,0.913
@suvojit-0x55aa
suvojit-0x55aa / gaussian.py
Created August 1, 2019 12:39
Python Numpy Gaussian Function
def gauss_map(size_x, size_y=None, sigma_x=5, sigma_y=None):
if size_y == None:
size_y = size_x
if sigma_y == None:
sigma_y = sigma_x
assert isinstance(size_x, int)
assert isinstance(size_y, int)
x0 = size_x // 2
@johnhw
johnhw / bivariate_matplotlib.py
Last active October 26, 2023 18:50
Bivariate colormap in matplotlib
# bivariate colormaps in matplotlib
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
## Bivariate colormapping
from scipy.interpolate import RegularGridInterpolator
@yeutterg
yeutterg / .gitignore
Last active February 25, 2023 03:23
How to use PSoC Creator with Git
### PSoCCreator ###
# Modified from https://www.gitignore.io/?templates=psoccreator
# You may need to add additional directories, e.g. CortexM3/
# Project Settings
*.cywrk.*
*.cyprj.*
# Generated Assets and Resources
Debug/
@hamzahamidi
hamzahamidi / open-cmder-here.md
Last active February 23, 2024 01:30
"Open Cmder Here" in context menu

"Open Cmder Here" in context menu

Edit 04/2021:

As of the lastest versions, just execute the following command .\cmder.exe /REGISTER ALL per Documentation.

Original Solution

To add an entry in the Windows Explorer context menu to open Cmder in a specific directory, paste this into a OpenCmderHere.reg file and double-click to install it.

@Glorfindel83
Glorfindel83 / broken-image-repairer.md
Last active August 19, 2023 14:08
Broken Image Repairer

Broken Image Repairer

What is the problem?

A long time ago, it was possible to inline images from all kinds of external sources. Since the switch from HTTP to HTTPS, this is no longer possible; only HTTPS sources are allowed. This leads to ugly blurbs like

alt text http://example.com/image.png

instead of a nicely formatted page with images. Sometimes, the links don't even work anymore, even with HTTPS images, which will show like this: ... Luckily, we have the Wayback Machine which is able to rescue some of the lost images. Since a picture often says more than a thousand words, it's important to bring back the post into its original state; important enough to justify the occasional bump of an old post (see below).

@leonardopaffi
leonardopaffi / arc-style.ini
Created November 21, 2018 09:31
Arc Theme for WXMaxima 18.02
fontEncoding=0
[Style]
fontname=
[Style/Background]
color=rgb(64, 69, 82)
[Style/Highlight]
color=rgb(0, 255, 255)
[Style/TextBackground]
color=rgb(255, 255, 255)
[Style/CellBracket]
@X-Raym
X-Raym / wavfile.py
Last active November 6, 2020 15:04 — forked from josephernest/wavfile.py
wavfile.py (enhanced): now moved to https://github.com/X-Raym/wavfile.py !!
# wavfile.py (Enhanced)
# Date: 20180430_2335 Joseph Basquin
#
# Mod by X-Raym
# Date: 20180706_1558
# * add log parameter for read function
# * return 'success' at end of write
# * renamed variables to avoid conflict with python native functions
# * correct bytes error
# * correct write function