Skip to content

Instantly share code, notes, and snippets.

View 3N4N's full-sized avatar

Enan Ajmain 3N4N

View GitHub Profile
#you have to put this in $profile or $profile.currentuserallhosts
$esc = [char]27
if($env:WT_SESSION){
$prevprompt = $Function:prompt
function prompt {
if ($pwd.provider.name -eq "FileSystem") {
$p = $pwd.ProviderPath
Write-host "$esc]9;9;`"$p`"$esc\" -NoNewline
}
-- Converts "* * *" Horizontal Rule to a "#" separator in Word DOCX
local hashrule = [[<w:p>
<w:pPr>
<w:pStyle w:val="HorizontalRule"/>
<w:ind w:firstLine="0"/>
<w:jc w:val="center"/>
</w:pPr>
<w:r>
<w:t>#</w:t>
</w:r>
@david-hoze
david-hoze / checksum_calculation.md
Last active May 5, 2024 17:27
How to Calculate IP/TCP/UDP Checksum
@romainl
romainl / vanilla-linter.md
Last active May 6, 2024 01:48
Linting your code, the vanilla way

Linting your code, the vanilla way

You may want a linter plugin to lint your code in Vim but you probably don't need it. At least try the built-in way before jumping on the plugin bandwagon.

Defining makeprg

autocmd FileType <filetype> setlocal makeprg=<external command>

This autocommand tells Vim to use <external command> when invoking :make % in a <filetype> buffer. You can add as many similar lines as needed for other languages.

@romainl
romainl / macros.md
Last active May 15, 2023 07:33
What to do with macros?

What to do with macros?

"Macro", you say? Or is that "recording"?

What people refer to as a "macro" is often actually a "recording".

You press qa to start recording your commands into register a, you do your thing, you stop your recording with q, and you play that recording back with @a.

Yes, what you just recorded is a macro, but macros are not necessarily recorded or even stored in registers.

@romainl
romainl / redir.md
Last active May 19, 2024 03:59
Redirect the output of a Vim or external command into a scratch buffer

Redirect the output of a Vim or external command into a scratch buffer

Usage (any shell)

Show full output of command :hi in scratch window:

:Redir hi

Show full output of command :!ls -al in scratch window:

@dfontana
dfontana / CmderZSH.md
Last active March 12, 2023 21:45
My setup guide for installing Cgywin, Mintty, Cmder, and ZSH.

What's this?

Instructions to obtain ZSH on a windows environment, without the input funny business presented by some other attempted solutions.

The final result is ZSH running on a mintty terminal, emulated by cygwin, and being handled by the popular cmder.

Why is this here?

For the benefit of myself and others. I've already followed these instructions twice. It took me hours to figure all this out, maybe someone else can save a few.

What exactly is covered?

  • Installing and setting up cmder

Welcome to WordGrinder

Important note for Windows users

WordGrinder is a port of a Unix program, and a few things don’t map well onto the way Windows works. There are some things you need to know.

  • the mouse is ignored. WordGrinder is keyboard driven.
  • the close button at the top right hand corner of the window won’t work. Instead, to quit, type CTRL+Q (or press ESC to open the menu and pick File_→_Quit).
@pascalpoitras
pascalpoitras / config.md
Last active May 11, 2024 04:13
My WeeChat configuration

WeeChat Screenshot

Mouse


enable