Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre commit checks #219

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.python-version
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: local
hooks:
- id: cheat-header
name: Cheat header
description: Require files to have the cheat YAML front-matter header
entry: '^---\n(syntax:.*\n)?(tags:.*\n)?---$'
args: [ '--multiline', '--negate' ]
edgester marked this conversation as resolved.
Show resolved Hide resolved
language: pygrep
exclude: '^\..*'
2 changes: 1 addition & 1 deletion bash
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# To implement a for loop:
for file in *;
do
do
echo $file found;
done

Expand Down
2 changes: 1 addition & 1 deletion chmod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
chmod a+x myscript.sh

# Set user to read/write/execute, group/global to read only (myscript.sh), symbolic mode
chmod u=rwx, go=r myscript.sh
chmod u=rwx, go=r myscript.sh

# Remove write from user/group/global (myscript.sh), symbolic mode
chmod a-w myscript.sh
Expand Down
2 changes: 1 addition & 1 deletion conda
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ conda env list
# To initialise an environment
conda create --name <environment_name>

# To initialise an environment with python3.10
# To initialise an environment with python3.10
conda create --name <environment_name> python=3.10

# To install from a file
Expand Down
1 change: 0 additions & 1 deletion cpanm
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,3 @@ cpanm --mirror <mirror-url> <Some::Module>

# use only the HTTPS mirror
cpanm --from https://some.mirror.host/ <Some::Module>

1 change: 0 additions & 1 deletion cpdf
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,3 @@ cpdf -blacktext in.pdf -o out.pdf
# Make sure all lines in in.pdf are at least 2 pts wide, writing to
# out.pdf.
cpdf -thinlines 2pt in.pdf -o out.pdf

2 changes: 1 addition & 1 deletion curl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ curl http://ifconfig.me/all.json
curl --limit-rate 1000B -O <outfile>

# To get your global IP:
curl httpbin.org/ip
curl httpbin.org/ip

# To get only the HTTP status code:
curl -o /dev/null -w '%{http_code}\n' -s -I URL
2 changes: 1 addition & 1 deletion du
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ du -shL
du -h --apparent-size

# To sort directories/files by size (human-readable):
du -sh * | sort -rh
du -sh * | sort -rh

# To list the 20 largest files and folders under the current working directory:
du -ma | sort -nr | head -n 20
46 changes: 23 additions & 23 deletions dwm
Original file line number Diff line number Diff line change
Expand Up @@ -2,78 +2,78 @@ Basic
=====
# launch terminal.
[Shift]+[Mod]+[Enter]

# show/hide bar.
[Mod]+[b]
[Mod]+[b]

# dmenu for running programs like the x#www#browser.
[Mod]+[p]
[Mod]+[p]

# push acive window from stack to master, or pulls last used window from stack onto master.
[Mod]+[Enter]
[Mod]+[Enter]

# focus on next/previous window in current tag.
[Mod] + [j / k]
[Mod] + [j / k]

# increases / decreases master size.
[Mod] + [h / l]
[Mod] + [h / l]


Navigation
==========
# moves your focus to tag 2.
[Mod]+[2]
[Mod]+[2]

# move active window to the 2 tag.
[Shift]+[Mod]+[2]
[Shift]+[Mod]+[2]

# increases / decreases number of windows on master
[Mod] + [i / d]
[Mod] + [i / d]

# move focus between screens (multi monitor setup)
[Mod] + [, / .]
[Mod] + [, / .]

# move active window to different screen.
[Shift]+[Mod]+[, / .]
[Shift]+[Mod]+[, / .]

# view all windows on screen.
[Mod]+[0]
[Mod]+[0]

# make focused window appear on all tags.
[Shift]+[Mod]+[0]
[Shift]+[Mod]+[0]

# kill active window.
[Shift]+[Mod]+[c]
[Shift]+[Mod]+[c]

# quit dwm cleanly.
[Shift]+[Mod]+[q]
[Shift]+[Mod]+[q]


Layout
======
# tiled mode. []=
[Mod]+[t]
[Mod]+[t]

# floating mode. ><>
[Mod]+[f]
[Mod]+[f]

# monocle mode. [M] (single window fullscreen)
[Mod]+[m]
[Mod]+[m]


Floating
========
# to resize the floating window.
[Mod]+[R M B]
[Mod]+[R M B]

# to move the floating window around.
[Mod]+[L M B]
[Mod]+[L M B]

# toggles to the previous layout mode.
[Mod]+[Space]
[Mod]+[Space]

# to make an individual window float.
[Mod]+[Shift]+[Space]
[Mod]+[Shift]+[Space]

# to make an individual window un#float.
[Mod]+[M M B]
[Mod]+[M M B]
10 changes: 5 additions & 5 deletions ed
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ tags: [ ed ]
:q quit
:Q quit without saving changes
:f {name} change buffer name
:w write to file using current buffer name
:w write to file using current buffer name
:w {file} write buffer to new file
:wq write buffer to existing file and exit

# Line-oriented addressing and movement
# Line-oriented addressing and movement
# `ed' uses line addresses to move around and operate within a buffer
# Move to or operate on single lines by entering the line number
# Move to or operate on ranges of lines using comma-separated values
Expand Down Expand Up @@ -53,12 +53,12 @@ r !{command} read output of {command} into buffer after current line
e test.txt edit file "test.txt"
45 `ed' returns character count as confirmation
1,3n display lines 1 through 3 with line numbers
1 This is line 1
1 This is line 1
2 This is line 2
3 This is line 3
2c change line 2
I am typing a new line 2
. end active edit
. end active edit
1,3n display lines 1 thorugh 3 with line numbers
1 This is line 1
2 I am typing a new line 2
Expand All @@ -71,7 +71,7 @@ wq write file "test.txt" and exit
g/foo/ search all lines for `foo' and display matching lines
g/foo/n search all lines for `foo'; display with line numbers

4,9/foo/ search lines 1 through 5 for `foo' and display matches
4,9/foo/ search lines 1 through 5 for `foo' and display matches
4,9/foo/n search lines 1 through 5 for `foo'; display with line numbers

# Replace
Expand Down
2 changes: 1 addition & 1 deletion emacs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
Run command in the scratch buffer C-x C-e

# Navigation ( backward / forward )

Character-wise C-b , C-f
Word-wise M-b , M-f
Line-wise C-p , C-n
Expand Down
2 changes: 1 addition & 1 deletion ethtool
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
syntax: bash
tags: [networking]
tags: [networking]
---
# To show statistics for the selected interface:
ethtool -S <interface>
Expand Down
2 changes: 1 addition & 1 deletion ffmpeg
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ cat mylist.txt
file '/path/to/file1'
file '/path/to/file2'
file '/path/to/file3'

ffmpeg -f concat -safe 0 -i mylist.txt -c copy output.mp4
2 changes: 1 addition & 1 deletion fzf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fzf --preview "file {}"
# Find files from find command and preview it with fzf
find . -type f -name "*.txt" | fzf --preview "head {}"

# Display border around fzf output
# Display border around fzf output
fzf --border sharp

# Output only selected files and pipe it to a file
Expand Down
4 changes: 2 additions & 2 deletions go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ go test -v -run=^TestFooBar$/^Baz$ .
go test -short ./...

# Handy flag - don't run further tests after a failure.
go test -failfast ./...
go test -failfast ./...


# Test all module dependencies.
Expand All @@ -104,7 +104,7 @@ go test -run=^TestFooBar$ -count=500 .
go fix ./...

# Create a new Github issue for Go's standard library
go bug
go bug


# Running and Comparing Benchmarks
Expand Down
8 changes: 4 additions & 4 deletions gpg
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@
gpg -K

Should show sec# instead of just sec.

# High-quality options for gpg for symmetric (secret key) encryption
This is what knowledgable people consider a good set of options for
This is what knowledgable people consider a good set of options for
symmetric encryption with gpg to give you a high-quality result.

gpg \
--symmetric \
--cipher-algo aes256 \
Expand All @@ -179,7 +179,7 @@
--no-symkey-cache \
--output somefile.gpg \
somefile # to encrypt

gpg \
--decrypt \
--pinentry-mode loopback \
Expand Down
4 changes: 2 additions & 2 deletions gyb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# To estimate the number and the size of all mails on youremail@gmail.com
gyb --email youremail@gmail.com --action estimate

# To backup from youremail@gmail.com to your local-folder
# To backup from youremail@gmail.com to your local-folder
gyb --email youremail@gmail.com --action backup --local-folder "~/MyLocalFolder/"

# To backup from youremail@gmail.com only important or starred emails to the
# default local folder GYB-GMail-Backup-youremail@gmail.com
gyb --email youremail@gmail.com --search "is:important OR is:starred"

# To restore from your local-folder to youremail@gmail.com
gyb --email youremail@gmail.com --action restore --local-folder "~/MyLocalFolder/"
gyb --email youremail@gmail.com --action restore --local-folder "~/MyLocalFolder/"
2 changes: 1 addition & 1 deletion ifconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ifconfig <interface>
ifconfig -a

# To take down / up the wireless adapter:
ifconfig wlan0 {up|down}
ifconfig wlan0 {up|down}

# To set a static IP and netmask:
ifconfig eth0 192.168.1.100 netmask 255.255.255.0
Expand Down
2 changes: 1 addition & 1 deletion java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ OpenJDK 64-Bit Server VM (build 11.0.8+10-post-Ubuntu-0ubuntu120.04, mixed mode,
java -Xms256m -Xmx2g -Xss1m -jar <filename.jar>

# To use the classpath variable
# It overrides the CLASSPATH of Environment variable but only for that session.
# It overrides the CLASSPATH of Environment variable but only for that session.
# If you restart the application you need to again set the classpath variable.
# You can use either: -classpath, --classpath or -cp
java -classpath <classpath> -jar <filename.jar>
Expand Down
14 changes: 7 additions & 7 deletions kitty
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ ctrl+shift+, - Move tab backward
ctrl+shift+alt+t - Set tab title

# Fonts and clipboard
ctrl+shift+c - Copy to clipboard
ctrl+shift+v - Paste from clipboard
ctrl+shift+s - Paste from selection
ctrl+shift+equal - Increase font size
ctrl+shift+minus - Decrease font size
ctrl+shift+backspace - Restore font size
ctrl+shift+c - Copy to clipboard
ctrl+shift+v - Paste from clipboard
ctrl+shift+s - Paste from selection
ctrl+shift+equal - Increase font size
ctrl+shift+minus - Decrease font size
ctrl+shift+backspace - Restore font size

# Windows
ctrl+shift+enter - New window
Expand All @@ -44,7 +44,7 @@ ctrl+shift+` - Move window to top
ctrl+shift+f7 - Visually focus window
ctrl+shift+f8 - Visually swap window
# Focus specific window
ctrl+shift+1, ctrl+shift+2 … ctrl+shift+0
ctrl+shift+1, ctrl+shift+2 … ctrl+shift+0

# Open/select
ctrl+shift+e - Open URL
Expand Down
2 changes: 1 addition & 1 deletion ls
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ls -d */ <dir>
ls -d .*/ */ <dir>

# To display all files sorted by changed date, most recent first:
ls -ltc
ls -ltc

# To display files sorted by create time:
ls -lt
Expand Down
8 changes: 4 additions & 4 deletions markdown
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Sub-bullets can be done with 2+ spaces or 1 tab
a. Lettered <-- there is mixed support for this format
4. Fourth
i. using roman numerals <-- there is mixed support for this format
ii. more stuff
ii. more stuff

## check list
There is limited support for rendering check lists:
Expand Down Expand Up @@ -86,7 +86,7 @@ Assuming you have a heading called `# My First Heading` then link is the case-in
Italic:
*em* _em_

Bold:
Bold:
**strong** __strong__

~~strikethrough~~
Expand All @@ -98,8 +98,8 @@ The alignment applies to the table data, not the header.

Left-aligned Stuff | Right-aligned Stuff | Center-aligned Stuff
| :--- | ---: | :---:
Some left stuff | Some right stuff | Some center stuff
Some left stuff | Some right stuff | Some center stuff
Some left stuff | Some right stuff | Some center stuff
Some left stuff | Some right stuff | Some center stuff

## Special Characters in Tables
First Header | Second Header
Expand Down
2 changes: 1 addition & 1 deletion multipass
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# List all options
multipass
multipass

# List existing VMs on your device
multiplass list
Expand Down
Loading