Skip to content

Instantly share code, notes, and snippets.

View henrywang's full-sized avatar

Xiaofeng Wang henrywang

View GitHub Profile
shortcut description
M-Delete use matcher to open and list recent (currently limited to 10) URLs
M-u activate URL selection mode
j/k Select next downward/upward URL (also with arrow keys)
g/G Select first/last URL (also with home/end key)
o/Return Open selected URL in browser, Return: deactivate afterwards
y Copy (yank) selected URL and deactivate selection mode
q/Escape Deactivate URL selection mode
C-- make font size smaller
wdio.conf.js
// Store the directory path in a global, which allows us to access this path inside our tests
const downloadDir = "/e2e/uploads/";
capabilities: [
{
// maxInstances can get overwritten per capability. So if you have an in-house Selenium
// grid with only 5 firefox instances available you can make sure that not more than
// 5 instances get started at a time.

TMUX

  1. copy to system clipboard
  • Normal mode: repfx-y
  • Visual mode: y

mutt

git

git stash -u (safe for git clean)

act, repeat, reverse

  • gj, gk move down and up by display lines
  • w, b commands target the start of a word
  • e, ge commands target the end of a word
  • f{char} Forward to the next occurrence of {char}
  • F{char} Backward to the previous occurrence of {char}
  • t{char} Forward to the character before the next occurrence of {char}
  • T{char} Backward to the character after the previous occurrence of {char}
  • I tend to use f{char} and F{char} in Normal mode when I want to move the cursor quickly within the current line
@henrywang
henrywang / eslint_tips.md
Last active February 23, 2019 13:53
ESLint tips

eslint configurations

plugins and extends

  1. plugins definds which plugins will be used in this project.
  2. extends definds which rules will be used in project.
  3. some of plugins, like jsx-a11y, if its recommends configuration configured in extends section, it'll not need to include plugin name into plugins section in eslint configuration files. because it includes itself into plugins section in its source code
  4. some of plugins, like mocha, its name has to be configured in plugins section even you configured its recommends configuration in extends section, because it does not include itself into plugins section in it source code.
  5. eslint ignores node_modules folder in the project root folder by default, but it does not ignore the other node_modules not in project root. Have to put it into .eslintignore
@henrywang
henrywang / Setup ZNC
Last active March 11, 2022 11:01
How to setup ZNC
# In this guide, the server is hosted by Linode and with Fedora 27 server as OS.
# Register a freenode nick name by following https://freenode.net/kb/answer/registration
# ZNC setup needs this information
sudo dnf -y update
# Follow docker installation doc https://docs.docker.com/install/linux/docker-ce/fedora/#os-requirements
sudo dnf remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->