- Capital letters do the opposite of small letters in command (Press shift to trigger capital letters)
_
(underscore) to move the cursor at the beginning of line (doesn't switch to insert mode)0
(zero) moves the cursor to the zeroth position of the line (doesn't switch to insert mode)
$
(dollar) to move the cursor at the end of line (doesn't switch to insert mode)d$
will delete from wherever your cursor is till the end of the linef<character>
to move cursor to the first occurrence of<character>
f(
to move cursor to first occurence of(
t<character>
to move cursor to upto but not on the first occurrence of<character>
t(
to move cursor to first occurence of(
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
docker exec -it container_name psql -U db_user -d postgres |
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
{ | |
"github/copilot.vim", | |
lazy = false, | |
config = function() -- Mapping tab is already used by NvChad | |
vim.g.copilot_no_tab_map = true | |
vim.g.copilot_assume_mapped = true | |
vim.g.copilot_tab_fallback = "" | |
-- The mapping is set to other key, see custom/lua/mappings | |
-- or run <leader>ch to see copilot mapping section | |
vim.g.copilot_filetypes = { |
https://www.nerdfonts.com/font-downloads
The following solution thanks to @hackerzgz & @snacky101 will install all nerd fonts;
brew tap homebrew/cask-fonts
brew search '/font-.*-nerd-font/' | awk '{ print $1 }' | xargs -I{} brew install --cask {} || true
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 socket | |
def port_scanner(host, ports): | |
hostname = socket.gethostbyname(host) | |
print(f'Scanning {host}: {hostname}') | |
for port in ports: | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
socket.setdefaulttimeout(1) | |
result = sock.connect_ex((hostname, port)) |
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
{ | |
"lsp": { | |
"deno": { | |
"settings": { | |
"deno": { | |
"enable": true | |
} | |
} | |
} | |
} |
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
git_current_branch () { | |
local ref | |
ref=$(command git symbolic-ref --quiet HEAD 2> /dev/null) | |
local ret=$? | |
if [[ $ret != 0 ]] | |
then | |
[[ $ret == 128 ]] && return | |
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return | |
fi | |
echo ${ref#refs/heads/} |
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
<?php | |
/* | |
* Plugin Name: Star Candidats | |
* Description: Liste des candidats qui ont postuler sur les offres star. | |
* Plugin URI: https://gist.github.com/iamando/8389c81a88afec8baf74c51c3b91112d | |
* Author: Ando | |
* Author URI: https://github.com/iamando | |
* Version: 1.0 | |
* License: GPL2 | |
*/ |
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
name: Auto Assign | |
on: | |
issues: | |
types: [opened] | |
pull_request: | |
types: [opened] | |
jobs: | |
run: | |
runs-on: ubuntu-latest | |
permissions: |
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
export function EditEvent() { | |
const [event, setEvent] = useState<DeepReadonly<Event>>() | |
// ... | |
// ❌ | |
event.attendees.push('foo') // Error | |
// ✅ | |
setEvent({ | |
...event, |