Skip to content

Blog

My blog about programming & other stuff

If you find a typo or would like to improve my posts feel free to submit a pull request to https://github.com/inwenis/blog.

Check out my other projects on my github like https://github.com/inwenis/collider where I tried to simulate Brownian motions.

My collection of various kata's I've done: https://github.com/inwenis/kata

I used to teach programming, out of sentiment I kept these two repos: - https://github.com/inwenis/sda.javawwa13.prog1.day5.complexity - https://github.com/inwenis/sda.javawwa13.prog1.day3.array_vs_hashtable

Enjoy!

You can reach me at inwenis at gmail.com

Me gusta

I don't have a better place for this yet so here's a list of links I like:

Google/Google Photos

Google products seem to slowly become worse, examples: Gmail no longer recognizes flight itineraries. Google Photos: Removed the map view. Doesn’t let you easily delete all photos. Doesn’t offer a simple way to downlo...

PowerShell quirk 2

tl;dr Let's say you have a File[1].txt file and you would like to read it. Get-Content "File[1].txt" ^ this returns nothing Why? PowerShell interprets [] as special characters. A range in this case. PowerShell is actu...

git goodies

git branch -d `git branch | grep feature` # delete all branches with feature in its name git branch | grep feature | xargs git branch -d # same as ^ git push origin --delete branchXYZ # git push origin :branchXYZ git ...

escape!

Why is escaping a character called escaping a character? When a C compiler (or any other compiler) encounters a " it thinks to it self "huh, this is the begninning or end of a string!". Say you need " in your string? ...

npm wsl EAI_AGAIN

Running npm ci on WSL (Windows Subsystem for Linux) failed with: npm ERR! syscall getaddrinfo npm ERR! errno EAI_AGAIN npm ERR! request to http://registry.npmjs.org/nodemon failed, reason: getaddrinfo EAI_AGAIN regist...

Post25

1024 * 1024 - this many bytes is an mibibyte (MiB). A megabyte like a megameter is 10^6 bytes. We all frequently say megabyte meaning a mibibyte. Like wise a kilobyte != kibibyte Unit Abbreviation Size in Bytes Kibiby...

Some neat fsx F#

My company had a hackathon focused on data scraping/processing. Each team had to scrape 3 endpoints. I came up with something similar to this: open System open System.Net.Http open System.Text let c = new HttpClient()...

PowerShell Gotcha! - dynamic scoping

PowerShell uses dynamic scoping. Yet the about_Scopes page doesn't mention the word "dynamic". Wird (wird - so weird that you need to misspell weird to get your point across). tl;dr; In PowerShell variables are copied...

Post22

W chatce w lesie siedzi Pan Nie odzywa się do nikogo bo jest sam Myśli ciężkie, głowa pogrążona w chorobie Zaraz zawiśnie na grobie Wspomnienia zaplątane same w sobie Siedzi, mruga, własną głowę zruga Pora zaraz będzi...

Post21

blood stains in the snow you left a few jumping home for me to remember the last walk snow will melt soon this memory I will not let fade you were loved and you loved us too of that I'm sure it's a tough call to let y...

Environment variable

but only in a specific directory The idea - use the Prompt function to check if you're in a specific dir and set/unset an env var: function Prompt { $currentDir = Get-Location if ("C:\git\that-special-dir" -eq $curren...

Json

Should I use System.Text. (STJ) or Newtonsoft. (previously .NET)? use STJ, Newtonsoft is no longer enhanced with new features. The author works for Microsoft now on some non-json stuff. JamesNK reddit comment Terms ma...

<3 regex

<3 regex https://regex101.com/r/RdCR7j/1 - set the global flag (g) to get all matches https://www.debuggex.com/ - havent't played with this a lot but I might give it a try, looks like a decent learning tool regex - us...

PowerShell "Oopsie"

Task - remove a specific string from each line of multiple CSV files. This task was added to the scripting exercise list. First - let's generate some CSV files to work with: $numberOfFiles = 10 $numberOfRows = 100 $fi...

My recommendations

Terminal etc. https://github.com/PowerShell/PowerShell - PowerShell 7+ - faster & better then Windows PowerShell https://ohmyposh.dev/ - amazing prompts - replace that old $ sign with amazing stuff https://github.com/...

PowerShell quirk

tl;dr In PowerShell if you want to return an array instead of one element of the array at the time do this: > @(1..2) | % { $a = "a" * $_; @($a,$_) } # wrong! will pipe/return 1 element at a time > @(1..2) | % { $a = ...

node packages updating

tl;dr > npm install depcheck -g - install depcheck globally > depcheck - check for redundant packages > npm un this-redundant-package - uninstall redundant packages (repeat for all redundant packages) Create a pull-re...

axios, cookies & more

axios, cookies & more axios axios - promise-based HTTP client for node.js when used in node.js axios uses http module (https://nodejs.org/api/http.html) in node axios does not support cookies by itself (https://github...