Skip to content

Instantly share code, notes, and snippets.

@DieNand
DieNand / GitInitTerminal
Created Dec 17, 2019
Commands for initialize new git repo and set remote to one on github.
View GitInitTerminal
git remote add origin https://github.com/user/repo.git
git add .
git commit "<insert message>"
git push
git pull
@DieNand
DieNand / curlinwindows
Created Dec 12, 2019
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
View curlinwindows
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 / WorkaroundLineEndings
Created Dec 12, 2019
Workaround for line endings in Powershell (some file types require unix like line ending to work, this helps in Windows)
View WorkaroundLineEndings
$file = ".\colors.ppm"
((Get-Content $file) -join "`n") + "`n" | Set-Content -NoNewline $file
View keybase.md

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: