Skip to content

Instantly share code, notes, and snippets.

View LinuxIsCool's full-sized avatar
💭
Preparing the ship.

Shawn Anderson LinuxIsCool

💭
Preparing the ship.
View GitHub Profile
@bhargavkakadiya
bhargavkakadiya / panel_dark_theme.py
Last active April 19, 2023 16:34
Python Holoviz Panel render white text color in dark themed Jupyter
# >> Jupyter Notebook
import pandas as pd
import param as pm
import panel as pn
RAW_CSS = """
body {
color: white;
}
"""
@bhargavkakadiya
bhargavkakadiya / example.py
Last active November 23, 2023 06:59
Simple example for Param Panel class interactions
## Run it on jupyter notebook for interactive panel
import param as pm
import panel as pn
pn.extension()
class A(pm.Parameterized):
a = pm.Number(2, step=1)
def get_a_squared(self):
return self.a * self.a
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@santteegt
santteegt / Quiz.ipynb
Last active January 31, 2021 01:54
TECLab weekend pop quiz. Inspired form https://github.com/gitcoinco/gitcoin_cadcad_model
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nikoheikkila
nikoheikkila / README.md
Last active April 15, 2024 17:15
Fish Shell function for sourcing standard .env files

envsource

⚠️ NOTE (20.5.2023): I don't really use this function at all anymore since there are now tools such as Taskfile, which reads the .env file for me sparing me the need to pollute my session with environment variables.


I've been using Fish shell for years which is great and all, but one thing that has got me frustrated is using it with .env files.

When attempting to run source .env in a project, I usually encounter this problem:

@codingforentrepreneurs
codingforentrepreneurs / Django for Jupyter.md
Last active June 16, 2023 19:38
Django Setup for use in Jupyter Notebooks

Django for Jupyter

It's true packages exist to make it "easy" to use Django inside of a jupyter notebook. I seem to always run into issues successfully running these packages. I've found the below method useful although I cannot recall how I discovered how this works (aka attribution needed).

Requirements

  • Virtual Environment (virtualenv, venv, pipenv, etc)
  • Django installed & project created (we'll use the project name cfehome)
  • Jupyter installed at least in the virtual environment
@thebashpotato
thebashpotato / autostart.md
Created September 12, 2020 17:17
How to run autostart scripts on Gnome

Auto start

All these files can be found in my dotfile repo

# First we must create the script we want to execute
# scripts should be stored in your $HOME/.local/bin

# The code below is called 'essentials' in my repo
@LinuxIsCool
LinuxIsCool / capsremap
Created June 5, 2020 03:03
This is the file I use to remap caps to escape and ctrl on Debian based OS (Ubuntu)
# make CapsLock behave like Ctrl:
setxkbmap -option ctrl:nocaps
# make short-pressed Ctrl behave like Escape:
# Default timeout is 500ms
xcape -t 300 -e 'Control_L=Escape'
@chrisnorris
chrisnorris / fcd.fish
Last active October 8, 2019 04:40 — forked from rumpelsepp/fcd.fish
Fuzzy cd for fish shell using fzf
function fcd --description "Fuzzy change directory"
if set -q argv[1]
set searchdir $argv[1]
else
set searchdir $HOME
end
# https://github.com/fish-shell/fish-shell/issues/1362
set -l tmpfile (mktemp)
find $searchdir \( ! -regex '.*/\..*' \) ! -name __pycache__ -type d | fzf > $tmpfile
@philippjfr
philippjfr / BokehFigure.py
Last active March 15, 2021 03:28
Defines a BokehFigure element which allows wrapping bokeh Figures in a HoloMap - BSD-3 License
from holoviews import Element, Store
from bokeh.models import Column
from holoviews.plotting.bokeh import ElementPlot
class BokehFigure(Element):
"""Wraps bokeh figure"""
class BokehFigurePlot(ElementPlot):
def initialize_plot(self, ranges=None, plot=None, plots=None, source=None):