- A good (albeit comprehensive) cheatsheet is found here: https://gist.github.com/tuxfight3r/60051ac67c5f0445efee
- You'll eventually find a subset of the shortcuts that you use most often.
- My personal list is:
- Ctrl + A / Home key: move to the beginning of the line
- Ctrl + E / End key : move to the end of the line
- Ctrl + K : delete from cursor to end of the line
This file contains hidden or 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 mne | |
mneraw = mne.read_raw_edf('file.edf') | |
electrodes = ['Fpz', 'Cz'] | |
# if electrodes to plot are not available, try to interpolate them | |
electrodes_not_in_list = [e for e in electrodes if e not in mneraw.ch_names] | |
if len(electrodes_not_in_list) > 0: | |
try: |
This file contains hidden or 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 math | |
from typing import Tuple | |
def vdeg_to_px( | |
gaze_vdeg:Tuple[float, float], | |
screen_size_cm:Tuple[float, float], | |
screen_size_px:Tuple[int, int], | |
viewer_distance_cm:float, | |
) -> Tuple[float, float]: | |
''' |
This file contains hidden or 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
Year | Value | ||||||
1880 | -0.17 | ||||||
1881 | -0.09 | ||||||
1882 | -0.11 | ||||||
1883 | -0.18 | ||||||
1884 | -0.29 | ||||||
1885 | -0.34 | ||||||
1886 | -0.32 | ||||||
1887 | -0.37 |
This file contains hidden or 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 Clipboard Fusion macro makes it easy to copy Latex from the Learning Standards Project into WebWork compatible formats | |
using System; | |
using System.Collections.Generic; | |
using System.Text.RegularExpressions; | |
// The 'text' parameter will contain the text from the: | |
// - Current Clipboard when run by HotKey | |
// - History Item when run from the History Menu | |
// The returned string will be: |
This file contains hidden or 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
#!/bin/bash | |
# download gcm | |
wget https://github.com/git-ecosystem/git-credential-manager/releases/download/v2.4.1/gcm-linux_amd64.2.4.1.deb | |
sudo apt install ./gcm-linux_amd64.2.4.1.deb | |
# configure | |
git-credential-manager configure | |
git config --global credential.credentialStore cache | |
git config --global credential.cacheOptions "--timeout 14400" |
This file contains hidden or 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 os.path | |
import yaml | |
import requests | |
import logging | |
from typing import Tuple | |
logging.basicConfig(level=logging.INFO) | |
class Porkbun(): |
This file contains hidden or 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 yaml | |
import requests | |
import json | |
# Load config file | |
with open('domain.YAML', 'r') as f: | |
data = list(yaml.safe_load_all(f)) | |
with open('apikeys.yml', 'r') as f: | |
apikeys = yaml.safe_load(f) |
This file contains hidden or 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
from typing import Tuple | |
import numpy as np | |
def kt_pca(X:np.ndarray) -> Tuple[np.ndarray, np.ndarray]: | |
""" | |
This is an implementation of the linear kernel PCA method ("kernel trick") | |
described in "Kernel PCA Pattern Reconstruction via Approximate Pre-Images" | |
by Schölkopf et al, ICANN, 1998, pp 147-15 | |
Parameters |