This is not a tutorial. If you're looking for a quick, easy, "how to
use git" kind of post, look elsewhere.
The goal of this post is to give you just enough understanding of
the git internals that you can build up a correct intuition of what
various git commands actually do under the hood.
After several attempts and tweets at Google I/O, I started wanting
to make my own notes into something more visually appealing and
presentable so that I can share my notes with everybody else who
want to learn the same subjects.
Apple’s default screensavers for Mac OS X are nice, but they get
boring after a while. Any true nerd would take matters into their
own hands when that happens!
If you want to make your own custom screensaver for Mac OS X, this
article is for you. We’ll walk through a tutorial for making a
screensaver which emulates the game
Pong. It’s going to be super
simple — this is just to get you started with how to make a
screensaver.
In this article you’ll find some tips to reduce the amount of RAM
used when working with pandas, the
fundamental Python library for data analysis and data manipulation.
In this article you will find 42 recommendations about coding in C++
that can help a programmer avoid a lot of errors, save time and
effort. The author is Andrey Karpov - technical director of "Program
Verification Systems", a team of developers, working on PVS-Studio
static code analyzer. Having checked a large number of open source
projects, we have seen a large variety of ways to shoot yourself in
the foot; there is definitely much to share with the readers. Every
recommendation is given with a practical example, which proves the
currentness of this question. These tips are intended for C/C++
programmers, but usually they are universal, and may be of interest
for developers using other languages.
And then there’s Podman: Podman is a reimplemented, compatible
version of the Docker CLI and API. It does not however implement all
the BuildKit Dockerfile extensions. On its own, then, Podman isn’t
as good as Docker at building images.
There is another option, however: BuildKit has its own build tool,
which is distinct from the traditional docker build, and this build
tool can work with Podman.
Let’s see where Podman currently is as far as BuildKit features, and
how to use BuildKit with Podman if that is not sufficient.
DM is a modern Python package manager with PEP
582 support. It installs
and manages packages in a similar way to npm that doesn't need to
create a virtualenv at all!
awk is a powerful tool. It is actually a Turing-complete
language,
meaning that you can technically write any kind of program with
it. You could implement the classic sorting algorithms or more
complex things such as a parser or an interpreter. Examples of this
kind can be found in the “AWK Programming
Language” book
written by awk‘s authors. The reason awk is still popular today,
though, has nothing to do with its generality and more with its
usefulness working in the command line.
Hello! I was talking to a Python programmer friend yesterday about
debugging, and I mentioned that I really like debugging using a
REPL. He said he’d never tried it and that it sounded fun, so I
thought I’d write a quick post about it.
This debugging method doesn’t work in a lot of languages, but it
does work in Python and Ruby and kiiiiiind of in C (via gdb).
Images are a massive part of the Internet. On the median web page,
images account for 51% of the bytes
loaded, so any
improvement made to their speed or their size has a significant
impact on performance.
I’ve been using Go for a few years now, mostly in my open source
project Lazygit. In my day job I use Ruby and Typescript, and I’ve
also spent some time with Rust. Each of those languages have design
quirks that can grind a developer’s gears, and although my own
precious gears have been ground by every language I’ve used, Go is
the only language that has made me feel indignant.
Years ago, OpenBSD gained two new security system calls,
pledge(2) (originally
tame(2))
and unveil. In both, an
application surrenders capabilities at run-time. The idea is to
perform initialization like usual, then drop capabilities before
handling untrusted input, limiting unwanted side effects. This
feature is applicable even where type safety isn’t an issue, such as
Python, where a program might still get tricked into accessing
sensitive files or making network connections when it shouldn’t. So
how can a Python program access these system calls?
In this post, I want to look at the biggest strengths and weaknesses
of Python, with more emphasis on the weaknesses, just because these
problems have been there for years now and some of the rough edges
bleed a lot.
When I decided the next post in my series on Python's syntactic
sugar would be on async for, I figured it would be straightforward. I have already done
for loops, so I
have something to build off of. The language reference also
specifies the pseudo-code for async for,
so I really didn't have to think too much about what the unravelled
form should be.
But then I decided I would break with my practice of using Python
3.8 as the reference version of Python I work from and instead pull
from Python 3.10 due to two additions in that version:
aiter()
and
anext(). That
decision turned out to complicate my life a bit. 😉
Web scraping is the process of downloading data from a public
website. For example, you could scrape ESPN for stats of baseball
players and build a model to predict a team’s odds of winning based
on their players stats and win rates. Below are a few use-cases for
web scraping.
Monitoring the prices of your competitors for price matching
(competitive pricing).
Collecting statistics from various websites to create a dashboard
e.g. COVID-19 dashboards.
Monitoring financial forums and twitter to calculate sentiment for
specific assets.
One use-case I will demonstrate is scraping the website indeed.com
for job postings. Let’s say you are looking for a job but you are
overwhelmed with the number of listings. You could set up a process
to scrape indeed every day. Then you can write a script to
automatically apply to the postings that meet certain criteria.
Over the weekend, a reader of my blog contacted me basically asking
about firewalls. Firewalls themselves are boring in my opinion, so
let’s talk about something Alpine can do that, as far as I know, no
other distribution can easily do out of the box yet: service
isolation using the base networking stack itself instead of
netfilter.
A recent Lobsters
post
lauding the virtues of AWK
reminded me that although the language is powerful and lightning
fast, I usually find myself exceeding its capabilities and reaching
for Perl instead. One such application is analyzing voluminous log
files such as the ones generated by this
blog. Yes, WordPress has
stats, but I’ve never let
reinvention of the wheel get in the way of a good programming
exercise.
I’ve been writing about performance for a long time. I like to think
I’ve gotten pretty good at it, but sometimes I look back on my older
blog posts and cringe at the mistakes I made.
This post is an attempt to distill some of what I’ve learned over
the years to offer as advice to other aspiring tinkerers,
benchmarkers, and anyone curious about how browsers actually work
when you put them to the test.
Writing functional code is often backwards and can feel more like
solving puzzles than like explaining a process to the computer. In
functional languages I often know what I want to say, but it feels
like I have to solve a puzzle in order to express it to the
language. Functional programming is just a bit too weird.
In my humble opinion, the best websites and web applications have a
tangible “real” quality to them. There are lots of factors involved
to achieve this quality, but shadows are a critical ingredient.
When I look around the web, though, it's clear that most shadows
aren't as rich as they could be. The web is covered in fuzzy grey
boxes that don't really look much like shadows.
In this tutorial, we'll learn how to transform typical box-shadows
into beautiful, life-like ones.