Leetcode gets a bad wrap it seems. Perhaps it is not so much Leetcode itself, as it is its use as an evaluation tool for interviews at Big Tech. People complain that it is not a fair reflection of one's skills as a software engineer. Would you rather hire a good leetcoder or someone with deep real world developer experience? While the nuances of this question may be worth exploring for hiring dec…
Once the code is satisfactory and is ready to be deployed to AWS (e.g. for testing inside a Lambda function), run the following commands:
1. Build image: docker build --platform linux/amd64 -t image-name:latest .
2. Authenticate to ECR: aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 11111222333.dkr.ecr.us-east-1.amazonaws.com
3. Tag image: docker tag …
I am experimenting with using the black
formatter in conjunction with flake8
and pylint
in vscode. One common issue I have encountered is that they disagree on line lengths. Based on these recommendations for black and pylint, I updated my vscode settings.json
as follows:
{
...
"flake8.args": [
"--max-line-length=88",
"--extend-ignore=E203"
],
&qu…
The following R code demonstrates how to make a nice stacked barchart using forcats
and ggplot
.
fct_lump()
lumps the least common values in an 'Other' category.fct_infreq()
reorders the factor level by the number of observations descending.fct_rev()
flips that order, which makes the the factors with the largest observations appear on the bottom of the plot.library(tidyverse)
library(viridis)…
Adding markdown was relatively straightforward thanks to this tutorial. All I had to do was to import the markdown package in the views.py
file and convert the post.body to markdown.
import markdown
# ...
def blog_detail(request, pk):
md = markdown.Markdown(extensions=["fenced_code"])
post = Post.objects.get(pk=pk)
post.body = md.convert(post.body)
# ...
I also had to modi…
This is my first blog post. I spent a couple of hours over MLK weekend trying to figure out how to make a Django website that could host my blog. I followed a tutorial from Real Python to get the blog structure, and then made use of the Render documentation to deploy it. I have pretty much zero webdev experience but I tried to speedrun this to get something working as quickly as possible, without…