This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ThrowingMathematicalOperators.swift | |
// Dose | |
// | |
// Created by Pho Hale on 6/26/18. | |
// Copyright © 2018 Pho Hale. All rights reserved. | |
// | |
import Darwin | |
import Swift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########## | |
# 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 ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// DockInfo.swift | |
// | |
// Created by Wessley Roche on 28/11/2016. | |
// | |
import Foundation | |
enum WBDockPosition: Int { | |
case bottom = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// SnappyWindow.swift | |
// A NSWindow that snaps to corners | |
// | |
// Created by Alasdair Monk on 03/02/2021. | |
// | |
import Foundation | |
import Cocoa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = {} |
OlderNewer