Skip to content

Instantly share code, notes, and snippets.

View CommanderPho's full-sized avatar

Pho Hale CommanderPho

View GitHub Profile
@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": "",
@CommanderPho
CommanderPho / repeatingWorkClockTest.py
Created September 26, 2023 02:03
Simple standalone script written in Python using tkinter to display the current time (clock time) periodically for a fixed duration.
import time
import tkinter as tk
from tkinter import font
""" 2023-09-22 - A very quick experiment I coded up to flash a fullscreen display of the clock-time for a short duration (`time_display_duration_ms`) every so often (`intra_display_delay_seconds`)
The idea was that this would increase perception of time and allow me to manage my time better.
Based on the observation that I remember the exact time (to the minute) whenever I log a note on the iPad and the timestamp is auto-inserted despite not intensionally looking at this information.
Only took like 10 minutes to code up and get working!
@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
@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
@CommanderPho
CommanderPho / SnappyWindow.swift
Created June 10, 2021 22:12 — forked from almonk/SnappyWindow.swift
SnappyWindow – A NSWindow that acts like the PIP Video Window from Safari
//
// SnappyWindow.swift
// A NSWindow that snaps to corners
//
// Created by Alasdair Monk on 03/02/2021.
//
import Foundation
import Cocoa
@CommanderPho
CommanderPho / DockInfo.swift
Created June 10, 2021 22:12 — forked from wonderbit/DockInfo.swift
Get the Dock position, size and hidden state in a Cocoa app
//
// DockInfo.swift
//
// Created by Wessley Roche on 28/11/2016.
//
import Foundation
enum WBDockPosition: Int {
case bottom = 0
@CommanderPho
CommanderPho / EventBroadcaster.swift
Last active May 22, 2020 21:16
Swift NotificationCenter (multicast global event management) Broadcaster/Listener example
// This example class registers to receive specific NotificationCenter events and responds to them
class ListeningExampleClass {
private var aNotificationCenterObservation: NSObjectProtocol?
// Called for example in .viewDidLoad() or initializer to register for notifications
func subscribeNotifications() {
let center = NotificationCenter.default
self.aNotificationCenterObservation = center.addObserver(forName: .eventActiveWorkspaceChanged, object: nil, queue: nil) { _ in
// Handle event broadcast stuff here...
@CommanderPho
CommanderPho / reclaimWindows10.ps1
Created September 5, 2019 18:00 — forked from alirobe/reclaimWindows10.ps1
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
##########
# Tweaked Win10 Initial Setup Script
# Primary Author: Disassembler <disassembler@dasm.cz>
# Modified by: alirobe <alirobe@alirobe.com> based on my personal preferences.
# Version: 2.20.2, 2018-09-14
# Primary Author Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
# Tweaked Source: https://gist.github.com/alirobe/7f3b34ad89a159e6daa1/
# Tweak difference:
#
# @alirobe's version is a subset focused on safely disabling telemetry, some 'smart' features and 3rd party bloat ...
@CommanderPho
CommanderPho / Win32_FileTime_to_POSIX.c
Created July 25, 2019 19:23
Converts a Win32 FileTime into a POSIX LONGLONG Timestamp. Credit (https://www.frenk.com/2009/12/convert-filetime-to-unix-timestamp/)
// Converts a windows FILETIME structure to a POSIX timestamp
// https://www.frenk.com/2009/12/convert-filetime-to-unix-timestamp/
LONGLONG FileTime_to_POSIX(FILETIME ft)
{
// takes the last modified date
LARGE_INTEGER date, adjust;
date.HighPart = ft.dwHighDateTime;
date.LowPart = ft.dwLowDateTime;
// 100-nanoseconds = milliseconds * 10000