Commit graph

16759 commits

Author SHA1 Message Date
William Carroll
45877a8b9c Include cache hit/miss info in return type
This can be useful downstream for diagnostics.
2020-12-12 02:43:35 +00:00
William Carroll
1a404a58de Expand 10^5 in README
I think it's more readable this way.
2020-12-12 02:41:09 +00:00
William Carroll
686766929a Simple Math tests
Calling `assert` within the `Enum.map` makes the errors more usable.
2020-12-12 01:36:22 +00:00
William Carroll
ee96a818e1 Define Server.semiprime
- Clear the boilerplate that `mix` generated
- Consume `Math.factor` to test which inputs are semiprimes
- Cache all inputs that are semiprimes as soon as we discover that they are
- semiprimes

I considered a couple things related to the Cache:
- Could save space by storing all semiprime factors in a tree. This would make
  the lookups more expensive. Also because the tree's depth would never exceed
  two (because all semiprimes only have two factors), the tree would be quite
  broad, and we may not be saving enough space for the trade to be worthwhile. I
  might be wrong about that though.
- We could consider pre-computing all semiprimes when we start the app, but
  without running some tests firsts, I'm not sure whether or not it's worth the
  trouble.
2020-12-12 01:32:31 +00:00
William Carroll
ab73220280 Define Cache.{list,clear} to help debugging
Since I'm often using `iex` for interactive development, these functions are
useful.
2020-12-12 01:31:51 +00:00
William Carroll
714ec29743 Define Cache and convert app to OTP
Define a simple in-memory key-value store for our cache.

TL;DR:
- Define `Cache` as a simple state-keeping `Agent`
- Define `Sup`, which starts our Cache process
- Define `App`, which starts our Supervisor process
- Whitelist `App` in `mix.exs`, so that it starts after calling `iex -S mix`
2020-12-12 01:04:39 +00:00
William Carroll
c0a88ba7d5 Add moduledoc to Extras
9 out of 10 doctors agree that every module needs a doc. Ask your doctor if
moduledocs are right for you!
2020-12-11 22:48:12 +00:00
William Carroll
9e2fbfde8e Move the habit-screens project into //website
I'd like to eventually deploy this to wpcarro.dev. Coming soon!
2020-12-11 22:47:04 +00:00
William Carroll
3feb8ceb9a Delete //website/habits
Accommodating space for my habit-screens project.
2020-12-11 22:46:37 +00:00
William Carroll
90035da32e Delete //website/habitgarden
This is change #2 in a series of other larger changes...
2020-12-11 22:45:39 +00:00
William Carroll
381c344563 Delete //website/days-of-week-habits
This is one small change in a series of other, larger changes.
2020-12-11 22:45:14 +00:00
William Carroll
1eab926121 Define stubbed default.nix
In case I want to package this project with Nix. For now, it's useful to store
this at the project root because it help my Emacs's `project-find-file`
function.
2020-12-11 22:43:53 +00:00
William Carroll
f1e4582392 Define Math module
Support `Math.factor` and cover it with tests.
2020-12-11 22:43:26 +00:00
William Carroll
6af5e4b82e Define Extras module
I'll use as the host for utility functions needed to extend the stdlib.
2020-12-11 22:42:55 +00:00
William Carroll
6ff814a6d3 Init Elixir project
Starting fresh with...

```shell
mix new server
```
2020-12-11 22:42:16 +00:00
William Carroll
c23a12746c Initialize the Semiprimes Service
This is an exciting take-home assignment because I get to write a service in
Elixir!
2020-12-11 18:52:35 +00:00
Vincent Ambo
ea936e0a78 feat(tazjin/aoc2020): Add solution for day 8, part 2
Change-Id: I03f46faf9b5b1b578b1131ecd08746f1adc3e87f
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2243
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-12-10 13:20:57 +00:00
Vincent Ambo
2485006197 refactor(tazjin/emacs): Always use completing-read instead of ivy
This is a step towards making the completing-read framework more
easily interchangeable (I'm eyeing selectrum).

Change-Id: I7a066e212a5384136defbba8f11ef9ed57abf22e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2240
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-12-09 14:09:23 +00:00
Vincent Ambo
93f0ab5af8 feat(tazjin/aoc2020): Add solution for day 8, part 1
I'm too tired for part 2.

Change-Id: Ic7058344806466276e3792e9ff9bbf660a18f672
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2239
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-12-08 23:13:55 +00:00
Vincent Ambo
3061b3228f feat(tazjin/aoc2020): Add (somewhat delayed...) solution for day 7
Solve time is like 36 hours, that must be a record!

Change-Id: I3713f033d83e6179a5d5fa7513952ee3864a6164
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2238
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-12-08 22:33:07 +00:00
William Carroll
aa788b128c Update groceries/list.org
Oh the times they are a-changin'
2020-12-07 20:11:32 +00:00
William Carroll
6c3792e881 Define another function to illustrate Reservoir Sampling
Documenting a few ideas about Reservoir Sampling while it's fresh on my mind.
2020-12-07 20:10:50 +00:00
William Carroll
c6f6d5f33b Fix typo
It's Splitwise... not Transferwise!
2020-12-07 20:10:33 +00:00
Vincent Ambo
42405bfa24 feat(tazjin/rlox): Synchronise parser state after errors
This lets the parser collect multiple errors instead of returning
after the first one, with some optimistic synchronisation after
encountering something that looks wonky.

Change-Id: Ie9d0ce8de9dcc7a3d1e7aa2abe15f74cab0ab96b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2236
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-12-06 17:34:57 +00:00
Vincent Ambo
1835b2be99 feat(tazjin/rlox): Wire up parser to the REPL
Change-Id: I940448c63ce105d53a0f281b6320ffb01378f207
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2235
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-12-06 14:58:39 +00:00
Vincent Ambo
4812fc2ee6 feat(tazjin/rlox): Implement parsing of parenthesised expressions
Change-Id: I0e6bd71fd787b719104ef93fc52df4090dc415b9
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2234
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-12-06 14:30:59 +00:00
Vincent Ambo
28002fcea5 refactor(tazjin/rlox): Add error plumbing in parser functions
Change-Id: I7ae3d721f76d8d69043f5ed077abbc70a18cbd92
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2233
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-12-06 14:30:59 +00:00
Vincent Ambo
5fcff11eae feat(tazjin/rlox): Implement parsing up to unary expressions
... with the exception of parenthesised expressions, because error
threading is not implemented yet.

Change-Id: I8d455d85e647548d5b71cbfd3d078f4970dab7fb
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2232
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-12-06 14:30:59 +00:00
Vincent Ambo
a8371b01df refactor(tazjin/aoc2020): Build all solutions in CI
This changes the structure of the output, too, where all AoC solutions
now end up in a big folder with `bin/day$n` executables.

Change-Id: I77928f4129489d06779b50059835925652688c9c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2231
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-12-06 13:02:31 +00:00
Vincent Ambo
54f143b8f7 feat(tazjin/aoc2020): Add solution for day 6
Change-Id: I107cc23bb77c618067af6cc47ced3c87464f4cba
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2230
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-12-06 11:59:22 +00:00
Vincent Ambo
7067f3a797 feat(tazjin): Check in higher-quality version of avatar
... found this in the same place as hanebuschtag.txt

Change-Id: Iff5f4867b6c1d7685edae8a190489f3efb4890bc
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2229
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-12-06 00:48:52 +00:00
Vincent Ambo
efd48011fc feat(tazjin): Check in hanebuschtag.txt
This old, legendary file should never be lost.

Change-Id: I2ae1607da24d684199c4136a880f56528d45a6e8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2228
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-12-06 00:48:52 +00:00
Vincent Ambo
3e1d63ccb3 docs: Update README with a link to the NixCon talk 2020-12-05 14:34:09 +01:00
Vincent Ambo
6d411c53ee feat(tazjin/aoc2020): Add solution for day 5
Change-Id: I771335f351be3418dbb589c429411748564f07f5
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2227
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-12-05 13:32:17 +00:00
Dave Nicponski
8ad5c55ad2 docs(config): Fix comment typo 2020-12-04 14:17:21 +01:00
Vincent Ambo
d4f6b67644 feat(tazjin/aoc2020): Add solution for day 4
Change-Id: I0b3c6a251bb0997b77bdd83593c65efcf471625c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2226
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-12-04 11:37:52 +00:00
Vincent Ambo
a9980bb631 feat(tazjin/aoc2020): Add solution for day 3
Change-Id: I84147731e1508032510a52cda28be74bbbb17c61
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2225
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-12-04 11:37:52 +00:00
Vincent Ambo
ea683b1ce8 feat(tazjin/aoc2020): Add solution for day 2
Change-Id: Id149ff13d1e903a578cdcdc3a8d0045cfefaecfa
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2224
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-12-02 10:05:28 +00:00
Kane York
50b32531ee feat(u/riking/aoc/day01): add day01 solution
Tests with the puzzle's sample inputs are included.

Change-Id: I32cd59b9e3894bde3d67ebdc3a977961b17bdb49
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2223
Reviewed-by: kanepyork <rikingcoding@gmail.com>
Tested-by: BuildkiteCI
2020-12-02 07:20:07 +00:00
Griffin Smith
8ae4854de8 fix(gs/system): Explicitly add all default i3 keybindings
Something I changed - perhaps removing lib.mkOptionDefault - caused
the *default* i3 keybindings (things like switching workspaces and
toggling the split layout which I had not added myself) not to get
added. This adds them back.

Change-Id: I301a346eabb4f7fc4499b60a4c26956fb1e08b0d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2218
Reviewed-by: glittershark <grfn@gws.fyi>
Tested-by: BuildkiteCI
2020-12-01 17:17:13 +00:00
Griffin Smith
902bf5bdd9 feat(gs/yeren): Swap caps+escape on built-in keyboard
This actually appears to be working this time!

Change-Id: I3e10eb7e1621a050e024b8b53313f13d44a999ae
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2217
Reviewed-by: glittershark <grfn@gws.fyi>
Tested-by: BuildkiteCI
2020-12-01 17:17:13 +00:00
Griffin Smith
6ecd36f425 fix(gs/yeren): Attempt to work around some of the text flickering issues
This is a whole pile of things suggested by the internet to fix the
weird text flickering issues I've been seeing. upon first look it seems
like one of the kernel params (or all of them, or some combination of
them) fixed the issue.

Change-Id: Idc98902b46d4cba3bab367f6e22fb9ad10b26a26
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2216
Reviewed-by: glittershark <grfn@gws.fyi>
Tested-by: BuildkiteCI
2020-12-01 17:17:13 +00:00
Griffin Smith
0e4d60cb9a feat(gs/system): Add me to the docker group
Running docker is silly if I can't access it

Change-Id: I476915dacd44fac1ce4c533a84849fa6175d8107
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2215
Reviewed-by: glittershark <grfn@gws.fyi>
Tested-by: BuildkiteCI
2020-12-01 17:17:13 +00:00
Griffin Smith
0c24c62281 feat(gs/system): Update xrandr layout for yeren
At some point I should just convert this into an option that gets set
per-machine...but whatever.

Change-Id: I745fc5126469e887f8657e990d14a7e8b5085330
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2214
Reviewed-by: glittershark <grfn@gws.fyi>
Tested-by: BuildkiteCI
2020-12-01 17:17:13 +00:00
Vincent Ambo
6aa6151146 feat(tazjin/aoc2020): Add solution for day 1
Change-Id: I9c5e7f69cac1940ddeb7932d4450e2bd3764e1f5
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2213
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-12-01 12:55:59 +00:00
Vincent Ambo
87f1e15baa chore(writeElispBin): Move from //overrides to //nix
... some legacy cleanup ...

Change-Id: I9e73451256f842e75ddbf1382badaf06c775c755
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2212
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2020-12-01 12:55:59 +00:00
Vincent Ambo
6c08bcc84d chore(tazjin/aoc2019): Move out of //fun
Change-Id: I9d065b672f4245b81444737dd900c8864447bc4d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2211
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2020-12-01 12:55:59 +00:00
Luke Granger-Brown
7d7c15c9a6 chore(lukegb): add keys.clouvider-lon01-nix
Change-Id: Iad46d9e2df5b508229367e0420dc155c9bec37b0
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2210
Reviewed-by: lukegb <lukegb@tvl.fyi>
Tested-by: BuildkiteCI
2020-11-30 23:18:39 +00:00
Andreas Rammhold
150b2fa799 chore(3p): move quassel to the right inherit statement
As the comment above the inherit statement says it is supposed to only
contain packages required for //third_party/nix. As much as I like IRC I
can't find a usage of Quassel within Nix itself. Perhaps a plugin to
report build status at some point?

Until that plugin mainfests we might as well move it to the correct
location.

Change-Id: I14fd6b698bb779b80829e7bebd5daa69cacdde78
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2177
Reviewed-by: kanepyork <rikingcoding@gmail.com>
Reviewed-by: glittershark <grfn@gws.fyi>
Reviewed-by: tazjin <mail@tazj.in>
Reviewed-by: lukegb <lukegb@tvl.fyi>
Tested-by: BuildkiteCI
2020-11-30 21:43:15 +00:00
Vincent Ambo
9cb98713d3 fix(tazjin/emacs): Don't use use-package for dottime.el
It doesn't work.

Change-Id: I06e95a43ca09f12c5763760e616b1b90c84dd265
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2209
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-11-30 16:46:51 +00:00