Skip to content

Instantly share code, notes, and snippets.

View CommanderPho's full-sized avatar

Pho Hale CommanderPho

View GitHub Profile
@lfhbento
lfhbento / userscript.js
Last active April 28, 2025 03:00 — forked from spf13/script.js
Download all your Kindle books before Feb 26, 2025
// ==UserScript==
// @name Kindle Download
// @namespace http://tampermonkey.net/
// @version 2025-02-20
// @description Download all your kindle books
// @author You
// @match https://www.amazon.com/hz/mycd/digital-console/contentlist/booksPurchases/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=amazon.com
// @grant none
// ==/UserScript==
@CommanderPho
CommanderPho / 01_multi_select_widget_readme.md
Created November 22, 2024 14:07 — forked from MattJBritton/01_multi_select_widget_readme.md
Multiple checkbox selection with searching with ipywidgets

Multiple selection with checkboxes and search field

This gist is forked from pbugnion's great work on building a searchable multi-checkbox using ipywidgets. You can find that work in this gist.

This version adds compatability with Jupyter Widgets' interactive_output() function, and also makes it easier to see which elements were selected by sorting them to the top. It also makes a few small changes to enable this to work in Jupyter Lab.

Image of dropdown

Usage

@CommanderPho
CommanderPho / workbench.colorCustomizations.json
Created June 5, 2024 22:16 — forked from dcts/workbench.colorCustomizations.json
A list of all Visual Studio Code customizable colors, grouped by UI region. Copy and paste into User Settings (comments are allowed) to tweak an existing theme or work on your own.
"workbench.colorCustomizations": {
// Contrast Colors - The contrast colors are typically only set for high contrast themes. If set, they add an additional border around items across the UI to increase the contrast.
"contrastActiveBorder": "",
"contrastBorder": "",
// Base Colors
"focusBorder": "",
"foreground": "",
"widget.shadow": "",
"selection.background": "",
"descriptionForeground": "",
Add-Type -AssemblyName System.Drawing
$refAssemblies = @(
[Drawing.Icon].Assembly.Location
if ($IsCoreCLR) {
[psobject].Assembly.Location
$pwshLocation = Split-Path -Path ([psobject].Assembly.Location) -Parent
$pwshRefAssemblyPattern = [IO.Path]::Combine($pwshLocation, 'ref', '*.dll')
(Get-Item -Path $pwshRefAssemblyPattern).FullName
@CommanderPho
CommanderPho / export_conda_env.py
Created November 4, 2022 23:48 — forked from joel-kelly/export_conda_env.py
Export all conda environments as yml files to a specified directory
import subprocess as sub
import re
import os
#modified from https://github.com/conda/conda/issues/5165
# create list of current environments
sub.check_call(" ".join(['conda','env','list','>','envs.txt']),shell=True)
# load and parse environment names
envs = {}
@CommanderPho
CommanderPho / Conda cheat sheet
Created November 2, 2022 21:08 — forked from elowy01/Conda cheat sheet
Conda cheat sheet#
//
# Deactivating the activation of the base environment in Python:
conda config --set auto_activate_base false
//
**Listing all installed packages
conda list
# If you want to list all installed packages along its channels:
conda list --show-channel-urls
//
#To install a package
@swiftui-lab
swiftui-lab / grid-trainer.swift
Last active October 21, 2024 15:24
A grid trainer for Grid views
// Author: SwiftUI-Lab (swiftui-lab.com)
// Description: this learning tool is designed to showcase the different
// Grid and GridRow view options, added in SwiftUI 2022. It is part of the
// blog article: https://swiftui-lab.com/eager-grids
//
import SwiftUI
import UniformTypeIdentifiers
// The root view of the application
struct ContentView: View {
@joel-kelly
joel-kelly / export_conda_env.py
Created July 8, 2022 18:07
Export all conda environments as yml files to a specified directory
import subprocess as sub
import re
import os
#modified from https://github.com/conda/conda/issues/5165
# create list of current environments
sub.check_call(" ".join(['conda','env','list','>','envs.txt']),shell=True)
# load and parse environment names
envs = {}
@CommanderPho
CommanderPho / DistanceAndDifferenceQuantificationConcepts
Created June 16, 2022 16:08
DistanceAndDifferenceQuantificationConcepts
Overlap - the degree two placefields overlap each other. Related to the statistical independence of the pair of placefields. Metric Type: Pairwise metric
Environment Coverage - the degree to which a set of placefields tile/span a given environment. Metric Type: Environment Map (collection of placecells) metric Larger values indicate that more of the environment has a placecell that represents it.
Specificity - the degree to which a given placefield is specific for a single or a few places, represented by few well-isolated peaks in the placemap. Metric Type: Single placecell metric A low value would indicate that the placefield is rather spatially diffuse across the environment.
Reliabilty - the degree to which a given placecell consistently responds to entering/exiting its preferred place. Metric Type: Single placecell metric A high value would indicate that the cell responds nearly every time that it enters the preferred place, and doesn't randomly respond when it's located at other non-preferred places.
Sta
@sriharijayaram5
sriharijayaram5 / spherical_3d.py
Created January 10, 2022 14:39
Spherical coordinates 3D PyQtGraph
import numpy as np
import matplotlib as mpl
from pyqtgraph.Qt import QtCore, QtGui
%gui qt5
import pyqtgraph as pg
from matplotlib import cm
pg.mkQApp()
## make a widget for displaying 3D objects
import pyqtgraph.opengl as gl