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
# Add the following to your keymap.cson file for traditional LTR style tab-switching instead of Atom's default MRU style. | |
# | |
# Get to keymap.cson through Settings -> Keybindings or ~/.atom/keymap.cson (on Mac) | |
'body': | |
'ctrl-tab ^ctrl': 'unset!' | |
'ctrl-tab': 'pane:show-next-item' | |
'ctrl-shift-tab ^ctrl': 'unset!' | |
'ctrl-shift-tab': 'pane:show-previous-item' |
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
""" =====VIM-PLUG===== | |
" Specify a directory for plugins | |
" - For Neovim: stdpath('data') . '/plugged' | |
" - Avoid using standard Vim directory names like 'plugin' | |
call plug#begin('~/.vim/plugged') | |
" Make sure you use single quotes | |
" Shorthand notation; fetches https://github.com/junegunn/vim-easy-align |
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
# Logs stdout and stderr | |
logFile='ask_reboot_log.txt' | |
exec > >(tee -ia $logFile) | |
exec 2> >(tee -ia $logFile >&2) | |
echo 'Hello' | |
echo 'error output' >&2 | |
# https://stackoverflow.com/questions/3173131/redirect-copy-of-stdout-to-log-file-from-within-bash-script-itself |
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 torch | |
from torchvision import datasets | |
class ImageFolderWithPaths(datasets.ImageFolder): | |
"""Custom dataset that includes image file paths. Extends | |
torchvision.datasets.ImageFolder | |
""" | |
# override the __getitem__ method. this is the method that dataloader calls | |
def __getitem__(self, index): |
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
#!/bin/bash | |
# from https://github.com/giswqs/manjaro-linux/blob/master/08-input-methods | |
echo "Installing input methods ..." | |
pkgs="adobe-source-han-sans-cn-fonts adobe-source-han-serif-cn-fonts fcitx kcm-fcitx fcitx-gtk2 fcitx-gtk3 fcitx-qt4 fcitx-qt5 fcitx-ui-light fcitx-table-other" | |
echo $pkgs | |
trizen -S $pkgs --noconfirm |
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
#!/bin/sh | |
# Executes a program as the currently logged in user. e.g. in /etc/crontab: | |
# */5 22 * * * root cron-prog notify-send "Closing computer now!" | |
[ "$#" -lt 1 ] && echo "Usage: $0 program options" && exit 1 | |
program="$1" | |
shift | |
user=$(whoami) |