Commit graph

16502 commits

Author SHA1 Message Date
William Carroll
dd9788fa73 Create line chart of UK confirmed corona virus cases
I was having trouble tracking the growth of corona virus cases in the UK.
Thankfully someone is publishing some daily COVID data as JSON. I downloaded
that data manually and plotted it using the chart.js library as a programming
exercise with Mimi.

Now I'm attempting to deploy to https://wpcarro.dev/covid-uk.

TODO(wpcarro): Prefer the live API data instead my soon-to-be-stale downloaded.
2020-03-18 22:08:09 +00:00
Abseil Team
2d2a8aea29 Export of internal Abseil changes
--
a85860e450815776c8753f34348f41ab0e918d36 by Gennadiy Rozental <rogeeff@google.com>:

Rename ComamndLineFlag's interface SetFromString as ParseFrom.

This is the name approved by C++ API review.

PiperOrigin-RevId: 301543521

--
28f31bae2a136854fd89f0a32f281d12a40f702c by Abseil Team <absl-team@google.com>:

Internal change

PiperOrigin-RevId: 301524919

--
a68da3d6fbbca4c5f41a20e99ed72bb1c5dd1165 by Abseil Team <absl-team@google.com>:

Introduce absl::base_internal::StrError, a portability wrapper around the various thread-safe alternatives to C89's strerror.

PiperOrigin-RevId: 301513962

--
92ccac3b6eb18cb41cddedbfdab53b9ad481505d by Andy Getzendanner <durandal@google.com>:

Introduce absl::base_internal::StrError, a portability wrapper around the various thread-safe alternatives to C89's strerror.

PiperOrigin-RevId: 301493389

--
8e196def47c250941202840d6a1de686d681cd3e by Abseil Team <absl-team@google.com>:

Internal change

PiperOrigin-RevId: 301363394

--
dd1dcffa6c47675ba4d198730a301bd408142298 by Gennadiy Rozental <rogeeff@google.com>:

Add validation for size of void* to match the size of free function pointer.

PiperOrigin-RevId: 301341331
GitOrigin-RevId: a85860e450815776c8753f34348f41ab0e918d36
Change-Id: I27c9d1365d3c9b4328d1587ab3ac38e2d09a6ec2
2020-03-18 17:29:54 -04:00
Griffin Smith
1722eac5f8 Add binding for missing variable in set-title
oops
2020-03-18 15:18:19 -04:00
Griffin Smith
24c36b781b Add org-clubhouse-clocked-in-story-id
Add an org-clubhouse-clocked-in-story-id function, for programmatically
querying the currently clocked-in clubhouse story ID
2020-03-18 15:18:17 -04:00
William Carroll
79b5fce68a Scatter blog post ideas for "Let's Learn Nix"
I may not use any of these. I'm just scrawling notes as blog posts to see if
anything sticks.
2020-03-17 22:42:22 +00:00
William Carroll
209fdf5726 Add ReasonML boilerplate
After some toil, I finally support basic ReasonML starter code.

I'm adding it to the nut-score directory because I would like to make a simple
webpage that render some nutritional facts about nuts with respect to the
ketogenic diet.

I'm not sure if I should include or exclude te .bs.js files.

See the README.md for more information.
2020-03-17 22:40:48 +00:00
William Carroll
166aed6e80 Disable redshift's fading animation
I originally passed the options `[ "-o" "-P" ]` to disable redshift's fading
animation, but what I wanted originally was the `[ "-r" ]` option.
2020-03-17 18:29:08 +00:00
William Carroll
862c695900 Work on "Let's Learn Nix: Dotfiles" blog post
It has been awhile since I have written a tutorial. I have spent 2-3 hours
working on this post, but I think I need to spend another 2-3 hours before I
publish it.

I expect to be able to write these posts faster as I practice.

I would like to create a few resources that I can reuse in each article for
things like:
- "Let's Learn Nix" reproducibility: Where I list all of the tutorials'
  dependencies: nix version, <nixpkgs> version, OS type and version, etc.
- Haskell type signature convention for Nix
- Ad hoc vs. declarative configuration for Nix
- Troubleshooting Nix: <nixpkgs> search, nix repl, searching the Nix codebase
2020-03-16 20:17:24 +00:00
Abseil Team
7853a7586c Export of internal Abseil changes
--
91ca367a7548270155721bdda74611aeea2a2153 by Abseil Team <absl-team@google.com>:

Replace the only usage of btree_node::swap with simpler logic using transfers and delete btree_node::swap.

Add a benchmark for constructing small containers.

PiperOrigin-RevId: 301169874

--
ff9d73a7125b7f8ab5733cda877204dfbfac138e by Derek Mauro <dmauro@google.com>:

Ensure ABSL_CXX_STANDARD is set.
Fixes #640

PiperOrigin-RevId: 301160106

--
14ca0beee8c109e532134e7e9da7b072da1bf911 by Abseil Team <absl-team@google.com>:

Rollback the change to make Cord iterators a fixed size.  That change increased the iterator size, which can cause a deep recursion call to hit the stack memory limit, in turn causing a signal 11 failure.

PiperOrigin-RevId: 301084915

--
619e3cd9e56408bdb8b3b5a1e08dda1e95242264 by Matthew Brown <matthewbr@google.com>:

Internal Change

PiperOrigin-RevId: 300832828

--
64f8d62ab4c4c78077dbe85a9595a8eeb6d16608 by Gennadiy Rozental <rogeeff@google.com>:

Fix for empty braces support.

We will call proper aggregate construction in case when {} is used as default value. In other words instead of "new T", we'll call "new T{}".

PiperOrigin-RevId: 300715686

--
db3f65594d6db8b104b01262f884dff465b696ef by Abseil Team <absl-team@google.com>:

Emscripten supports thread-local storage nowadays.

PiperOrigin-RevId: 300675185
GitOrigin-RevId: 91ca367a7548270155721bdda74611aeea2a2153
Change-Id: I3344f745f9c3fc78775532b1808442fabd98e34a
2020-03-16 15:11:38 -04:00
hakana
84e53c8d2b
Add support for RM4 mini with device type 0x610e (#320) 2020-03-16 19:56:06 +01:00
William Carroll
eb402bca74 Create derivation for learn.wpcarro.dev
Creating a derivation to abstract over the build process for learn.wpcarro.dev.
2020-03-16 16:54:16 +00:00
William Carroll
ebf0ef7e34 Delete .xsessionrc
Nix home-manager generates an .xsession file for me. I believe there are a few
files for managing X-sessions:
- .xinitrc
- .xsession
- .xsessionrc: Only exists on Debian systems, which is why home-manager
  generates an .xsession file instead. gLinux is a Debian system.

Whenever I close Emacs, another Emacs initializes. I believe this is because
after I allowed home-manager to manage my X-sessions, I unintentionally
supported two X-session configuration files: .xsession and .xsessionrc; both of
these files initialize Emacs.

I'm deleting my .xsessionrc, and I'm hoping that will remove the issue.
2020-03-16 15:28:24 +00:00
William Carroll
1487d06660 Support autorandr
Enable autorandr with Nix home-manager. I discovered autorandr when looking
through the home-manager source code. I was hoping it would automatically
enable/disable my external monitor when I connect/disconnect my HDMI cable, but
it doesn't.

With autorandr, I run...

```shell
> autorandr --load mobile
```

...to load my randr settings for just my laptop without the external monitor,
and I run...

```shell
> autorandr --load docked
```

...to load my randr settings for my external monitor.

I'm not sure if this brings much more value than my existing display.el module,
but I'm willing to try it for now.
2020-03-16 13:59:20 +00:00
William Carroll
fbf66c423b Remove setting for enabling both laptop and external monitor
Currently I prefer working with one screen at a time, so I'm preferring to
toggle between external monitor and laptop monitor.
2020-03-16 13:58:18 +00:00
William Carroll
319652fe08 Solve InterviewCake's second-largest-item-in-bst
Return a function that returns the second largest item in a binary search
tree (i.e. BST).

A BST is a tree where each node has no more than two children (i.e. one left
child and one right child). All of the values in a BST's left subtree must be
less than the value of the root node; all of the values in a BST's right subtree
must be greater than the value of the root node; both left and right subtrees
must also be BSTs themselves.

I solved this problem thrice -- improving the performance profile each time. The
final solution has a runtime complexity of O(n) and a spacetime complexity of
O(1).
2020-03-16 11:45:34 +00:00
Felipe Martins Diel
1a1169f1a9
Add support for 0x5f36 devices and RM4 series (#317)
* Add support for 0x5f36 devices

This type of device requires a header in the payload. The rest is the same.

* Improve request header assignment

* Change code sending header

I just found out that this device uses a different header for sending codes. This update addresses this issue.

* Improve authentication

Use the error code to check if the authentication was successful.

* Use default value when devtype is None

* Use generic remote type if devtype is None

* Extend support to RM4 series

I just realized that RM4 devices use the same header. I will take the opportunity to extend support to these devices as well.

* Add device type 0x62be and create rm4 class 

The rm4 class will improve code scalability. Just add the RM4 type to this class and it will just work.

* Remove comma
2020-03-16 09:49:41 +01:00
William Carroll
56d8d1d7b2 Solve InterviewCake's bst-checker problem
Write a function that returns true if a given binary tree is a valid binary
search tree (i.e. if all of root's left nodes are less than root.value, all of
root's right nodes are greater than root.value, and both left and right subtrees
are also valid binary search trees).
2020-03-15 23:09:29 +00:00
William Carroll
47a11b76a2 Solve InterviewCake's balanced-binary-tree problem
Write a predicate for determining if a binary tree is "super balanced", which
means that the depths of all of the tree's leaves are equal or differ by at most
one.
2020-03-14 12:48:37 +00:00
William Carroll
0f82a527de Mark duplicate InterviewCake questions as DONE
I wrongfully assumed that the relationship between a question and a question
category was one-to-one; it is actually one-to-many. This explains why I
completed the "Cafe Order Checker" and "Top Scores" questions twice.

I'm marking the questions that I've completed as DONE because I would prefer to
do every question once and then prioritize repeating the questions with which I
experienced difficulty.
2020-03-14 12:20:43 +00:00
William Carroll
ea4bf1ba96 Remove UK qualifier to London
Vincent tells me that saying "London, UK" is a very *American* thing to do. I
think that is his polite way of telling me that it's naive.
2020-03-13 23:14:03 +00:00
William Carroll
e93248bc31 Fix broken link to @tazjin's Twitter
Link to @tazjin's Twitter instead of @dmjio's Twitter.
2020-03-13 23:10:06 +00:00
William Carroll
aa9b81fe21 Move wrapNonNixProgram to utils module
Define the wrapNonNixProgram in my Nix utils module.
2020-03-13 23:03:57 +00:00
William Carroll
02721a25a7 Init the "Let's Learn Nix" blog series
I'm creating a short blog series to help newcomers learn Nix.
2020-03-13 23:03:42 +00:00
William Carroll
c46fd5ee14 Define wrapNonNixProgram as a helper utility
Write a simple Nix expression to DRY up my writeShellScriptBin wrapper pattern.
2020-03-13 17:25:05 +00:00
William Carroll
beeed2baa2 Prefer locally installed /usr/bin/git
From what I understand, gLinux and Nix are sometimes compatible and sometimes
incompatible.

Some nix-installed programs rely on system state that differs from gLinux's
system state. In other cases, Google wraps existing programs (e.g. git) to
provide Google-specific configuration.

Ever since I switched to home-manager and set `programs.git.enable = true`,
magit, which uses the git that PATH exposes hasn't been able to push, fetch, and
a few other commands.

TODO(wpcarro): Define a base home.nix that my gLinux and NixOS machines can
extend.
2020-03-13 16:54:51 +00:00
William Carroll
bd67b07f52 Add default value for pkgs parameter in shell.nix
Commands like `nix-shell shell.nix` couldn't resolve `pkgs` without a default
value. I'm unsure how I expected this to work previously...
2020-03-13 16:52:40 +00:00
William Carroll
a2a5a62836 Solve InterviewCake's top-scores problem
Write a function to sort a list of scores for a game in linear time. While I had
previously solved this in python, I hadn't marked the todo.org file, so I ended
up doing this again.

"Perfect practice makes perfect."
2020-03-13 16:51:38 +00:00
Eelco Dolstra
d77eaf7976
style.css: Remove
This file is licensed under the GPL. Originally, Nix was also
GPL-licensed so that was fine. However, we later changed the license
to the LGPL but missed the fact that style.css has an incompatible
license.

Since the Nix manual at nixos.org uses its own styling, we can remove
this file.

Fixes #3392.

(cherry picked from commit 9c7e90f414067eb59170bde952d5b8ac03c8f46c)
2020-03-13 15:07:45 +01:00
Eelco Dolstra
8999beacc3
mk/README.md: Remove
The make-rules repo is not maintained.

(cherry picked from commit cc5c81822d298544489ea0861d266c3a5137759a)
2020-03-13 15:07:42 +01:00
William Carroll
2695eae15d Define fish function, ptree
Get all pstree outputs for a given process name.

Usage:
```fish
> ptree ssh-agent
```

I'm unsure if I like home-managers; I'd prefer defining this functions in a
functions.fish file for a few reasons:
- I like syntax highlighting.
- home-manager compiles this into poorly formatted fish code.
2020-03-13 12:21:43 +00:00
William Carroll
c2522a1b7a Extend default-cache-ttl and max-cache-ttl for gpg-agent
Preferring eight hours for each of these values.
2020-03-13 12:21:01 +00:00
William Carroll
4509fb5e50 Restore ssh-agent initialize in ~/.profile
For two days I tried using gpg-agent to emulate ssh-agent, but it did not work
the same way as ssh-agent. For example, gcert stopped working. Also, when I
tried adding keys to ~/.gnupg/sshcontrol using `ssh-add ~/.ssh/id_rsa`, the
command failed.

While the concept of reusing gpg-agent for ssh-agent appeals to me...
- Fewer agent processes
- pinentry support
...in practice, it fell short of my expectations. Some or all of this may be
because I tried running this on a gLinux machine.
2020-03-13 12:17:58 +00:00
Vincent Ambo
576f190972 fix(ops/nixos/nugget): Ensure that 'nuggetEmacs' is used for EXWM 2020-03-12 23:49:39 +00:00
Vincent Ambo
080c3591ca chore(ops/nixos/nugget): Disable DHCP for Remarkable USB conn
This otherwise holds up the boot process if the device is not
connected, which is annoying.
2020-03-12 23:27:12 +00:00
Vincent Ambo
de362fd278 feat(ops/nixos/nugget): Install google-c-style in Emacs 2020-03-12 23:27:12 +00:00
Abseil Team
c6954897f7 Export of internal Abseil changes
--
66a0a46462692378f77518f9db766a218bfac40b by Derek Mauro <dmauro@google.com>:

Internal change

PiperOrigin-RevId: 300565981

--
2a1ad67662b2e22beec7d3be019e6bba23c41c7f by Derek Mauro <dmauro@google.com>:

Fix CompressedTuple move constructor on MSVC
Imports GitHub #637

PiperOrigin-RevId: 300545840

--
a3ee3ad036bbb6b0031121fd58299e5c59a243e1 by Derek Mauro <dmauro@google.com>:

Disable LLVM's XRay instrumentation on Android
Fixes #626

PiperOrigin-RevId: 300540906

--
87999244b1f825e585ec12a431086cb60daeb24f by Gennadiy Rozental <rogeeff@google.com>:

Increase max cord depth by 2.
After reviewing of the paper we can prove that the algorithm in fact can lead to slightly larger max depth.

PiperOrigin-RevId: 300422376

--
98de175ee8ad33290ef883c167c2de4414a11007 by Abseil Team <absl-team@google.com>:

Use *opt/opt-> instead of opt.value() in an example, after checking the optional has a value.

PiperOrigin-RevId: 300253502

--
1107aa0acf0fe743ef50173e02e48f0d4eb572ef by Derek Mauro <dmauro@google.com>:

Stop overriding the default system C++ dialect in CMake

CMake on MacOS has some very strange defaults, like Wno-c++11-extensions,
and doesn't seem to respect CMAKE_CXX_STANDARD, so use CMAKE_CXX_FLAGS instead.

PiperOrigin-RevId: 300180753
GitOrigin-RevId: 66a0a46462692378f77518f9db766a218bfac40b
Change-Id: Icd7b84c49306441b012cb87f244cc92a11697db8
2020-03-12 12:46:00 -04:00
i-do-cpp
b92f35f65f
Fix CompressedTuple move constructor on MSVC (#637) 2020-03-12 10:41:43 -04:00
William Carroll
3c73f73517 Remove the "Professional Emacs" blog post
I don't intend to finish this blog post and since my blog is live, I'd rather
not show it on the internet.
2020-03-11 22:58:46 +00:00
William Carroll
c026f1a4c5 Add drafts for future blog posts
- caffeine.md: an explanation of my theory that caffeine antagonizes
  mindfulness.
- nix-and-hugo.md: a short tutorial explaining how I use Nix, the package
  manager and Hugo, the static site generator, to host my blog.
- self-hosting.md: explain how I installed NixOS on my used Acer laptop.
2020-03-11 22:54:50 +00:00
William Carroll
7163b299f5 Add social channels to footer of learn.wpcarro.dev
Per Mimi's suggestion, I think adding these channels helps customers better
understand that I'm a real person.
2020-03-11 18:34:20 +00:00
William Carroll
bcc2d1e902 Emphasize copy for learn.wpcarro.dev
- Embolden money amounts
- Italicize "Start today."
2020-03-11 18:33:46 +00:00
Vincent Ambo
8df1371b9d chore(tools/emacs): Remove unimportant 'important' label from graph 2020-03-11 05:55:22 +00:00
William Carroll
c23e263a9f Attempt to support gogs
Gogs claims to be an easy-to-use Git server and web frontend written in
golang. I'm eager to try it as an alternative to cgit.
2020-03-10 23:13:52 +00:00
William Carroll
73db632090 Support unclutter with home-manager
I removed the code that initializes unclutter from .profile - preferring to
start it with home-manager.
2020-03-10 23:07:30 +00:00
William Carroll
d784c1d157 Support keynav with home-manager
I removed the startup code from .profile. I also depend on a fork of
home-manager until I submit my PR from wpcarro/home-manager into
rycee/home-manager.
2020-03-10 23:07:30 +00:00
William Carroll
405be98069 Manage xsession with home-manager
redshift didn't properly work because it couldn't read the DISPLAY environment
variable. I can fix this ad-hoc with `systemctl --user import-environment
DISPLAY`, but home-manager will do this automatically if I allow it to manage my
xsession.
2020-03-10 23:07:30 +00:00
William Carroll
a7ad2e3712 Support redshift
redshift is the f.lux of Linux; it filters blue light from your screen.
2020-03-10 23:07:30 +00:00
William Carroll
8c0a56a03e Restore Emacs server
I think I removed the `(server-start)` call when I was debugging some EXWM
issues. I have stabilized my configuration considerably since then, and I'd like
to use the Emacs server.
2020-03-10 23:07:30 +00:00
William Carroll
921e6c2905 Remove dockerd startup from .profile
1. I haven't used docker in awhile.
2. If I need to restore the docker daemon, I will reach for a home-manager
   solution.
2020-03-10 23:07:30 +00:00
William Carroll
8e5152cd84 Remove PATH additions from .profile
I'd like to remove this and prefer using Nix-based solutions for PATH
maintenance.
2020-03-10 23:07:30 +00:00