Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am dienand on github.
  • I am dienand (https://keybase.io/dienand) on keybase.
  • I have a public key whose fingerprint is F241 97C3 8154 05A8 241A A89D 3A11 A588 79C3 382B

To claim this, I am signing this object:

@DieNand
DieNand / WorkaroundLineEndings
Created December 12, 2019 20:10
Workaround for line endings in Powershell (some file types require unix like line ending to work, this helps in Windows)
$file = ".\colors.ppm"
((Get-Content $file) -join "`n") + "`n" | Set-Content -NoNewline $file
@DieNand
DieNand / curlinwindows
Created December 12, 2019 21:32
Example of using curl in Windows (powershell). In this case it is actually shorthand for Invoke-RestMethod which differs a bit from curl on Linux
curl -Method POST -Uri <url> -ContentType 'application/json' -Body '{"content": "Whatever you want to put in here"}' -UseBasicParsing
-UseBasicParsing
Prints output directly to console and prevents the requirement for having to set up Internet Explorer in Windows 10
See https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-restmethod?view=powershell-6 for more details.
@DieNand
DieNand / GitInitTerminal
Last active January 16, 2024 22:06
Commands for initialize new git repo and set remote to one on github.
git remote add origin https://github.com/user/repo.git
git add .
git commit "<insert message>"
git push
git pull