Adding a personal introduction, overview of coding, pricing, and contact
information.
Also using a CDN to install TailwindCSS, which the TailwindCSS authors
discourage, but I don't want to setup a complicated build process at the
moment.
See the README.md for more context about this project.
TODO: I configure nginx to serve static files from /var/www/learn. I'd like to
symlink /var/www/learn to briefcase/learn as part of my `rebuild` script, but I
don't currently.
readTree uses the output attribute set of default.nix as the value for
nixos.socrates, which disables me from resolving nixos.socrates.rebuild since
there is no rebuild attribute in the output attribute set from default.nix.
If I rename default.nix -> configuration.nix, I can resolve
nixos.socrates.{configuration,hardware,rebuild}.
Nix complains that `nixos.socrates` is not a function but a set. By adding
`{ ... }:` to the top of the file, I'm hoping to change it from a set to a
function.
I'm currently setting NIX_PATH in ~/briefcase/shell.nix. This means when I call
`nix/rebuild-emacs` from a buffer that is inside the briefcase directory, the
command succeeds because NIX_PATH is properly defined. When I call
`nix/rebuild-emacs` from any other location it fails.
I'm hard-coding the NIX_PATH in this command so that I can call
`nix/rebuild-emacs` from any buffer that is currently active.
I patched home-manager locally to support fzf keybindings for fish. I will PR
this into home-manager, but I haven't yet, which means that my home.nix file
depends on my local ~/home-manager.
I've been consistently using vterm enough that I don't think I will change
shells anytime soon. Couple this with my previous commit where I hint that I'd
like to curb all terminal usage if possible, and it seems unlikely that I'll
want to keep this terminator configuration.
As I pruned increasingly more dependencies, the few dependencies that desktop
and laptop hosted were too trivial for me to justify supporting. And so, I no
longer support them.
Support commonly used programs like fd, exa, bat, etc.
For now, I'm unsure how to manage the programs in my emacs/default.nix with my
home.nix. I'll wait until I have a stronger opinion to handle this.
Prefer starting lorri with home-manager.
Note: I could have removed the `systemctl --user start lorri.service` line
before switching to home-manager by calling `systemctl --user enable
lorri.service`. This would have made a symlink in
`~/.config/systemd/user/default.target.wants`.
I haven't used Tmux for months.
I also suspect that using the terminal in general may be a crutch. Ideally I
could replace everything I do in the terminal with Emacs analogues. Perhaps one
month I'll force myself to work without a terminal to see what happens.
While I do still technically own a Google cloudtop device, I haven't used it in
at least six months. In the interest of pruning non-critical dependencies, I'm
deleting it. I can alway restore it thanks to Git.
I didn't port everything from .ssh/config to home-manager. I omitted a few hosts
that I don't connect to anymore. I also omitted the `corp-ssh-helper`
configuration.
Today I wrote myself a custom fish prompt. It's mostly what I'd like, but I'd
like to finely tune it a bit. I'd like to create a separate repository to
release this. In that repository, I'll explain why I wrote this.
This problem challenged me: without using division, write a function that maps a
list of integers into a list of the product of every integer in the list except
for the integer at that index.
This was another greedy algorithm. The take-away is to first solve the problem
using brute force; this yields an algorithm with O(n*(n-1)) time
complexity. Instead of a quadratic time complexity, a linear time complexity can
be achieved my iterating over the list of integers twice:
1. Compute the products of every number to the left of the current number.
2. Compute the products of every number to the right of the current number.
Finally, iterate over each of these and compute lhs * rhs. Even though I've
solved this problem before, I used InterviewCake's hints because I was stuck
without them.
I should revisit this problem in a few weeks.
I'm considering this essay one of my favorites from Paul Graham. The essay
argues that good taste and bad taste exist. Graham argues against relativism in
design and cites a variety of examples of architecture, typography, writing,
sketching, painting, aircraft design, and others that bolster his opinion.
TL;DR - Design should strive to be:
- Simple: Prefer simplicity to complexity when possible.
- Timeless: Design today for tomorrow by pleasing yesterday.
- Pointed: Focus always on the problem; don't work for work's sake.
- Suggestive: Constrain usage without suffocating the user.
- Humorous: Prefer light-heartedness to sobriety.
- Difficult: "Good design" is takes time, effort, and tremendous skill.
- Ostensibly effortless: Solutions should look obviously correct.
- Symmetric Appreciate symmetry.
- Natural: In nature, form ever follows function.
- Iterative: Write; rewrite; rewrite; rewrite; throw away; write; publish.
- Imitative: Be confident enough to copy others' existing, beautiful ideas.
- Communal: Pay attention to "Schelling points" and join the party. Don't be the
Milanese Da Vinci.
- Fearless: Question the status quo; expect others to challenge your solution.
When I build socrates using `sudo nixos-rebuild [...] switch`, my
`nixos-config` (i.e. <briefcase/nixos/socrates/default.nix>) is a simple Nix
anonymous function. Typically readTree populates my pkgs, briefcase, depot
function parameters with <nixpkgs>, <briefcase>, <depot>, but `nixos-rebuild` is
unaware of `readTree`.
For now I'm manually importing these dependencies, and I'm leaving a TODO to
reconsider switching to the `{ pkgs, briefcase, ... }` style when I better
understand NixOS.
When I first created the monorepo, I borrowed @tazjin's monorepo's. I adapted
his depot/default.nix, replacing some of his paths with my paths. This worked
for me until recently.
I attemped to include <briefcase/monzo_ynab/job> as a systemd unit for my NixOS
machine, socrates. NixOS failed to build my changes, and I didn't fully
understand my default.nix since I borrowed most of it from @tazjin. I spent the
past week looking at the `fix` function. I realized that I didn't fully
understand how fixed-point recursion worked. This sent me down a rabbit hole
terminating with me studying the Y and Z combinators.
Ironically, after understanding the `fix` function, I realized that I didn't
need to use it where I was consuming it. I ended up pruning most of my
configuration, which resulted in this commit.
Yours truly,
lambda f: (lambda x: f(x(x)))(lambda x: f(x(x)))
Write a function that returns the highest product of three integers within a
list of integers. This solution uses a greedy algorithm that solves for the
answer in linear time. The space complexity is constant.
Write a function that returns the maximum profit that a trader could have made
in a day. I solved this using a greedy algorithm which constantly sets the
maximum profit by tracking the lowest price we've encountered.