First few lines in golang

Intro I’ve been casually looking into the go language without trying it much. Now it’s time to write so go code :) Golang Looping First discovery there is no while keyword in golang, I was pretty surprised I thought I was missing something. I then look in the spec and there is only for. I like that they only have limited number of keywords. i := 0 for i < 10 { fmt.Println(i) } Return statements Return statement can be specified in function definition E.g: ...

April 5, 2021 · 2 min · Nolan

Check broken links in Markdown

Broken links It’s always frustrating to follow a dead link, so I would like to avoid that on my blog. I’ve found couple of projects that could help: https://github.com/raviqqe/muffet https://github.com/linkchecker/linkchecker https://github.com/stevenvachon/broken-link-checker These projects looks to be a good fit, however I would have adapt the CI part. If not I would be checking my current online version and not the latest changes, one idea could be to spin up a local web server and test again it. Or I could do deploys on Pull Requests for example. ...

April 4, 2021 · 1 min · Nolan

Pandas meets SQL

Pysql I was exploring data from a CSV, I used Jupyter notebook as I’m a bit familiar with it and it’s a great fit for this kind of use case. It’s very easy to load data in a dataframe, however I don’t use pandas often enough and cannot remember all the functions. I just wanted to write SQL queries from the dataframe itself. import matplotlib.pyplot import pandas as pd from pandasql import sqldf df = pd.read_csv('data.csv') pysqldf = lambda q: sqldf(q, globals()) q = """SELECT SUBSTR(deployment_date, 1, 9) as date, SUBSTR(deployment_date, 1, 9) - SUBSTR(created_date, 1, 9) as ct FROM df where deploy_type='k8s' and SUBSTR(created_date, 1, 9) > '12/27/2021' """ df = pysqldf(q) It’s a cool project, however I would not using it much for 2 reasons: ...

March 3, 2021 · 1 min · Nolan