about summary refs log tree commit diff
path: root/scratch
AgeCommit message (Collapse)AuthorFilesLines
2020-11-12 Add coding exercises for Facebook interviewsWilliam Carroll66-0/+2994
Add attempts at solving coding problems to Briefcase.
2020-11-12 Style habit screen to accommodate footerWilliam Carroll1-3/+3
Add spacing to the bottom to make space for the footer.
2020-10-11 Tweak stylesWilliam Carroll1-2/+2
Add spacing to help the app breathe.
2020-10-11 Support multiple HabitTypesWilliam Carroll2-73/+196
I could have and should have broken this change into smaller pieces, but when I came up for air, I had changed too much, and most of the changes are intermingled. Oh well... this is an exciting change! Include habits for: - Morning - Evening - Payday (the 25th) - First of the Month - First of the Year Since the Morning and Evening routines might be a bit noisy, I'm excluding them from the output using a flag, `include{Morning,Evening}`, which I support in the UI to toggle their visibility. I made *much* more progress on this app that I expected to today, and I *think* -- short of supporting a database and a server -- I'm close to being *completely* finished. Wahoo!
2020-10-11 Support Msg to clear all completed tasksWilliam Carroll2-5/+45
Add a simple button to clear all completed tasks.
2020-10-11 Render time remaining in UIWilliam Carroll1-2/+38
Show the number of minutes remaining before completing all of the tasks.
2020-10-11 Move tailwind function into Utils moduleWilliam Carroll2-17/+63
Instead of accepting `List (String, Int)`, accept `List Strategy` where `Strategy` defines whether or not the string of selectors should be applied to the element. I'm also renaming it `class` so I can just use `Utils.class`; `tailwind` has little to do with the function itself.
2020-10-11 Expand Habit typeWilliam Carroll2-48/+127
Include: - habitType: Daily, Weekly, Yearly... what's the trigger? - minutesDuration: Estimation of how long it'll take to complete
2020-10-11 Tweak stylesWilliam Carroll1-3/+6
- Change header to blue - Change habit to gray when completed - Prefer app font for footer instead of monospaced font
2020-10-11 Create UI module for common componentsWilliam Carroll2-17/+27
Create UI.elm to house components like `button`, which is a simple HTML button with `focus:outline-none` applied as a `class`, which is an accessibility feature that I don't need for this touch-screen application. I like this pattern more than my more opinionated patterns for UI modules in Elm where I'd define all of the arguments as a record type (i.e. kwargs).
2020-10-11 Prefer handwritten fontWilliam Carroll2-2/+8
Use the Google Fonts API to fetch a handwritten font, which gives the app a modicum of personality. There are more "best practices" ways to do this, such as: - Download the font once, and include it in the bundle - Extend the Tailwind configure to recognize the font - Ditch the inline <style> block But I don't need the performance benefits that the first bullet provides. And the second two bullets are more relevant for a larger application with more than one font. So I think in this case, the easiest solution is best. Also: - Use `container` and `mx-auto` to constrain content for wide screens
2020-10-10 Support viewing different daysWilliam Carroll2-12/+124
Allow users to browse the habits of the other days of the week.
2020-10-10 Ensure weekday is updatedWilliam Carroll2-2/+8
This ensures us that our view is consistent within ~1 minute of reality.
2020-10-10 Tweak stylesWilliam Carroll1-3/+3
- Increase font size for header - Prefer a bulleted list - Reduce horizontal padding
2020-10-10 Add a footerWilliam Carroll1-0/+4
With personal information and information about the project's stack.
2020-10-10 Remove Nap from Saturday; prefer Yin YogaWilliam Carroll1-1/+1
Since Warm Yin Yoga is at 15:00, it's difficult to attend that *and* nap.
2020-10-10 Begin working on Habit Screens projectWilliam Carroll12-0/+414
Created a small MVP for digitizing my weekly habits. Much more to come. Lots of things happening: - Copied the boilerplate to get started - Added a brief project-level README - Outlined my ambitions in design.md See README and design.md for more context on this project.
2020-10-03 Ignore comments in output for grocery exportWilliam Carroll1-3/+14
TL;DR: - Ignore lines starting with "#" - Tidy up the code
2020-10-03 Update my grocery list for Bermondsey LondonWilliam Carroll1-44/+40
I haven't updated this list since I was living in Dargow, Germany over the summer. Now that I've settled down, and I'm situated in the London Bridge area, I'm updating the list.
2020-08-20 Move scratch/brilliant into //assessmentsWilliam Carroll10-426/+0
Where it belongs...
2020-08-20 Drop support for dir-locals.nix, <nixpkgs>, etc.William Carroll7-17/+15
In the spirit of Marie Kondo, I'm tidying up! TL;DR: - Prefer .envrc `use_nix` and delete all dir-locals.nix files - Remove ~all references to <nixpkgs>, <unstable>, <depot> and prefer referencing each with briefcase.third_party.{pkgs,unstable,depot} - Delete nixBufferFromShell function since I was only using that in dir-locals.nix files
2020-08-20 Revise previous opinions about absolute paths GT <bracket-notation>William Carroll1-1/+1
Unforeseen problem: `buildkite-agent` runs its builds in a separate directory, so if I want the `nix-build` command to build the newly checked out code, I need to set <briefcase> to the CWD.
2020-08-12 Consume buildHaskell functionsWilliam Carroll1-20/+10
Use the newly defined `buildHaskell` function for a few of my existing Haskell projects. So far, it works as intended!
2020-08-12 Prefer snake-shift instead of a row-by-row shiftWilliam Carroll5-37/+57
Per the assignment's instructions, the `Shift n` operation should treat the *entire keyboard* like a cycle and shift that. I was erroneously treating *each row* like a cycle and shifting those one-by-one. This change fixes that. In addition, it also: - Updates README.md with expected inputs and outputs - Updates test suite - Adds `split` dependency to {default,shell}.nix
2020-08-12 Adds property tests to generically test keyboard transformationsWilliam Carroll1-1/+25
Tests: - HorizontalFlip - VerticalFlip - Shift n
2020-08-12 Prefer literal, not computed, examples in the unit testsWilliam Carroll1-21/+19
TL:DR: - Remove unused imports: Test.QuickCheck and Control.Exception - Remove calls to `reverse` and `Utils.rotate` with their results
2020-08-12 Provide more useful instructions for building this projectWilliam Carroll3-18/+67
TL;DR: - include a default.nix to allow users to build an named executable - emphasize in the README that the user needs Nix to build this project - pin nixpkgs to a specific commit and fetch it from GitHub
2020-08-12 Generate coords function from existing qwerty keyboardWilliam Carroll1-44/+8
Per my take-home assignment's reviewer's comments, with which for the record I agree, I should generate the character->coordinate table from my existing qwerty keyboard definition. The best part is: by doing this I found a bug: Notice how the original '0' character was mapped to the Coordinate (0,0)... thus every subsequent digit key (i.e. the first row) is off-by-one.
2020-08-06 Re-type type using the altered keyboardWilliam Carroll5-7/+129
Remember: always read the instructions; that's the most important part.
2020-08-06 Support Transforms.optimizeWilliam Carroll2-0/+19
Partially optimize inputs and document rules for further optimizations we can make.
2020-08-05 Apply a series of transformation to a QWERTY keyboardWilliam Carroll4-32/+51
TL;DR: - Accept input from the CLI - Add a project README.md
2020-08-05 Support App.transformWilliam Carroll5-1/+57
Apply the transform to a Keyboard. Onwards to the final demonstration!
2020-08-05 Support parsing the list of transformsWilliam Carroll2-7/+65
Using Haskell's Text.ParserCombinators.ReadP library for the first time, and I enjoyed it thoroughly! It's nice avoiding a third-party library like MegaParsec.
2020-08-05 Define an instance for Show for a KeyboardWilliam Carroll1-0/+23
This will help me debug.
2020-08-05 Create a Utils moduleWilliam Carroll1-0/+8
To stylize things...
2020-08-05 Add some the scaffolding for testingWilliam Carroll2-0/+20
As I attempt to habituate TDD, I should have some examples of tests to minimize all friction preventing me from testing.
2020-08-04 Create small command line program that parses argumentsWilliam Carroll3-0/+56
Before starting my take-home assignment, the instructions advised me to create a "Hello, world" program in the language of my choice. Since I'm choosing Haskell, I created this example as my starter boilerplate.
2020-07-20 Move AOC into //scratchWilliam Carroll8-0/+701
Also rename it advent-of-code-2019 since I expect to participate this year as well. TODO: Should directories and files be name like-this or like_this?
2020-07-17 Partially complete IO chapter exercisesWilliam Carroll1-0/+35
Inconveniently, I do not have the cipher code that I wrote from a previous chapter, and I'm not eager to reimplement it. TODO - Implement encrypt - Implement decrypt - Read all characters from STDIN
2020-07-17 Update grocery listWilliam Carroll1-13/+33
- Add new entries - Change quantities of existing entries
2020-07-17 Partially complete the "Basic Libraries" chapter exercisesWilliam Carroll1-0/+60
I was instructed to benchmark these functions, but I couldn't get the benchmarking library to run using Nix -- although I'm *sure* it's possible. Unfortunately the book recommends using `stack`, which I couldn't reproduce.
2020-07-14 Complete exercises for "Non-Strictness" chapterWilliam Carroll1-0/+6
I completed most of the exercises for this enlightening chapter in ghci.
2020-07-12 Finish exercises for Monad Transformer chapterWilliam Carroll1-6/+110
I expect to look back on this code and cringe, but... it compiles!
2020-07-12 Partially complete Monad Transformer exercisesWilliam Carroll1-0/+79
Write Functor, Applicative, Monad instances for: - MaybeT - EitherT - ReaderT
2020-07-11 Partially complete some of the exercises for Composing TypesWilliam Carroll1-0/+75
I believe there are two exercises sets in the "Composing Types" chapter. Here are *some* of my answers so far... I'm having trouble implementing Foldable for Compose. I was able to implement a version of it by adding the (Functor f) constraint to the instance signature, but I think I cheated. I will revisit these problems as well as the earlier exercises later.
2020-07-01 Impl part 3/3 for MemoWilliam Carroll1-29/+10
Refactor the caching policy for the Memo by evicting the elements that have been the least-recently-accessed. Python's heapq module default to a min-heap. By storing our heap elements as (UnixTime, a), we can guarantee that when we call heappop, we will get the element with the lowest UnixTime value in heap (i.e. the oldest). When we call heappush, we use (time.time(), key) and these values -- by having the largest UnixTime, will propogate to the bottom of the min-heap.
2020-07-01 Support part 2/3 for the Memo problemWilliam Carroll1-4/+64
Bound the size of the memo by creating a BoundedQueue. Whenever we add elements to the BoundedQueue, we remove the oldest elements. We use the BoundedQueue to control the size of our dictionary that we're using to store our key-value pairs.
2020-07-01 Implement part 1/3 for "Memo"William Carroll1-0/+19
After hearing from a Jane Street recruiter, I decided to dust off some of the DS&As knowledge. I found this article online, which outlines an example problem called "Memo": https://blog.janestreet.com/what-a-jane-street-dev-interview-is-like/ Here's part 1 of the solution in Python.
2020-07-01 Convert grocery list to an .org fileWilliam Carroll2-18/+15
Ensure that the export.hs script refers to the .org file.
2020-07-01 Complete exercises for Reader and State chaptersWilliam Carroll2-0/+242
It's beautiful how State is just Reader that returns a tuple of (a, r) instead of just a, allowing you to modify the environment (i.e. state). ```haskell newtype Reader r a = Reader { runReader :: r -> a } newtype State s a = State { runState :: s -> (a, s) } ```