Product | Total Fat in container | Price | $/g fat |
---|---|---|---|
Green Valley Organics Lactose Free | 340g / 30g * 9g = 102g | $4.49 | $0.04401 |
Snowville Creamery Creme Fraiche | 336g / 30g * 11g = 123.2g | $5.99 | $0.04862 |
Wallaby Organic | 454g / 30g * 10g = 151.333g | $4.69 | $0.03099 |
Hands down, the winner by taste was Green Valley Organics. The lactose free part sounds great. However, it appears to come at a cost of less Vitamin A. This product shows 4% RDA for Vitamin A versus 8% for the other two.
The lowest cost, and also tasty, product was Wallaby Organic. This one says it contains 2g of carbs compared to 1g for the others. Unfortunately these numbers are alllowed to be rounded in weird ways so I’m not going to be too worried about the difference here.
If you know you like butterfat, the Snowville brand claims 36% butterfat on the lid. And it is also yellow in color instead of white. It was quite tasty as well.
I learned this week that too much protein can raise blood sugar levels and prevent ketosis. Adding sour cream to my diet should help me reduce the amount of protein I consume.
My target macro-nutrient levels are:
Category | Quantity | Percent |
---|---|---|
Carbs: | 20g | 4.3% |
Protein: | 128g | 27.5% |
Fat: | 141g | 68.2% |
The goal is to plan out my meals in such a way that I don’t have to count macro nutrient levels for everything I eat.
I typically use Solarized Dark during the day. However, when Redshift starts working in the evening, the screen gets very difficult to see. I had been using a bash script in combination with .bashrc
to change the colors of the default profile. This stopped working when I updated to Ubuntu 16.04. So it was back to roughing it, and making the change manually until I found another Gnome terminal solarized script to script this change.
However, I ran into another problem with this script. It would not run correctly from cron since it uses dconf
(on Ubuntu 16.04) and the $DBUS_SESSION_BUS_ADDRESS
is not available in the limited cron environment.
I finally found this great answer on stackoverflow that explain how to get a correct $DBUS_SESSION_BUS_ADDRESS
with cron enviroment. I then created the following short script to change the only three parameters that I care about, background-color
, foreground-color
, and bold-color
in my Default profile.
The first three lines are the important part for getting the script to run from cron.
#!/bin/bash
# inspired by https://github.com/Anthony25/gnome-terminal-colors-solarized
# cron script to switch terminal colors in the evening
# Set up environment if necessary
export DISPLAY=:0
# -z True if the length of string is zero.
if [ -z $DBUS_SESSION_BUS_ADDRESS ]; then
# http://stackoverflow.com/questions/10374520/gsettings-with-cron
PID=$(pgrep gnome-session)
export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-)
fi
[ -z $DBUS_SESSION_BUS_ADDRESS ] && exit
# http://ethanschoonover.com/solarized
# light
base3='#fdfdf6f6e3e3' # background
base00='#65657b7b8383' # body text/default code/primary content
base01='#58586e6e7575' # optional emphasized content
# dark
base03='#00002b2b3636' # background
base0='#838394949696' # body text/default code/primary content
base1='#9393a1a1a1a1' # optional emphasized content
profile_id="$(dconf read /org/gnome/terminal/legacy/profiles:/default|sed s/\'//g)"
# echo $profile_id >> /home/antonios/terminal-color.log
# http://www.tldp.org/LDP/abs/html/functions.html
set_dark() {
dconf write /org/gnome/terminal/legacy/profiles:/:$profile_id/background-color "'$base03'"
dconf write /org/gnome/terminal/legacy/profiles:/:$profile_id/foreground-color "'$base0'"
dconf write /org/gnome/terminal/legacy/profiles:/:$profile_id/bold-color "'$base1'"
}
set_light() {
dconf write /org/gnome/terminal/legacy/profiles:/:$profile_id/background-color "'$base3'"
dconf write /org/gnome/terminal/legacy/profiles:/:$profile_id/foreground-color "'$base00'"
dconf write /org/gnome/terminal/legacy/profiles:/:$profile_id/bold-color "'$base01'"
}
# http://www.tldp.org/LDP/abs/html/comparison-ops.html
# quotes needed here, otherwise error when no arguments
if [ "$1" = "light" ]; then
set_light
elif [ "$1" = "dark" ]; then
set_dark
else
# http://www.tldp.org/LDP/abs/html/quotingvar.html
# quotes not needed in this case, because value will always be single word (number)
if [ "$(date +%H)" -ge 17 ]; then
set_light
else
set_dark
fi
fi
I then added the following line via crontab -e
0 17 * * * ~/dotfiles/term-color.sh light
This setup switches all open terminals from dark to light at 5 pm. This has the added benefit of being a reminder to wrap up my work day when the screen turns to the light color scheme. This only works while I am logged in. That is perfectly OK since I only need the switch when I am on my computer. I also run this script when I login to make sure that the terminal is the correct color for the time of day. That part is set up in the graphical Startup Applications app in Ubuntu.
One more step is required for this to work correctly in Vim solarized colorscheme. Both Neovim and Vim8 support timers so this code will work for either.
I added these lines to my .vimrc
:
colorscheme solarized
let hour = strftime("%H")
if hour >= 17
set background=light
else
set background=dark
endif
if hour < 17
let minute = strftime("%M")
let second = strftime("%S")
func ColorHandler(timer)
set background=light
endfunction
let t = timer_start(((17-hour)*60*60-minute*60-second)*1000, 'ColorHandler')
endif
You may be thinking that running a timer is too much overhead for this. I did not notice any performance hit.
If this post was interesting or useful to you I would love to hear your comments below.
]]>I learned to touch type in 2015. So as I’m building muscle memory for typing it makes sense to me to use the same software for all my writing. Jekyll lets me quickly write down my thoughts in markdown format, push to github, and I’m done sharing my thoughts with the whole world.
Another nice feature:
Jekyll also offers powerful support for code snippets:
The first step was following the instructions at these two links:
The initial install was easy enough. However, the urls were not setup as is commonly considered best practice for SEO purposes. Wordpress does the same thing. Why is the default not set up for best practices?
To make the urls match the titles without any categories or dates, what is commonly referred to as ‘pretty urls’ I added the following line to the _config.yml
file.
Jekyll does not come with commenting capabilities built in. Many people use Disqus and I decided to do the same. I found the documentation lacking in clarity as to how to set it up best. Disqus site has code you can copy and paste. There are two variables that you will need to set in this code.
I set my disqus site id up in my _config.yml
file
The next addition to this site was my collection of book notes. Since Jekyll has collections that seemed like a great mechanism for creating a new series of related information like book notes. I have to thank Ben Balter for his excellent post Explain like I’m five: Jekyll Collections. His description was instrumental in my implementation of collections.
The main benefit in using collections like this is that I get to keep all related writing in a subdirectory separate from regular posts or other types of writing that I might want to share. Another benefit for readers of my site is that I can set it up so that they can easily look through related information that is available on the site.
The first step is to add the collection to your _config.yaml
file. Below is the configuration to create a books
collection.
Now throughout Jekyll I can refer to books
just as I would posts
and get the same result.
The next thing to do is to create a listing page that will show all the book notes. For this blog I simply copied the default index.html
to books.html
and made a few minor modifications:
Here’s what my edited books.html
looks like:
title: Books
post
to book
except for css class names. I did not choose to change the css to look different than the posts.Using reversed
shows the most recent book notes at the top of the page.
An added benefit to adding the books.html
file next to the default index.html
file in the root directory is that Jekyll automatically creates a menu item for each file there. So this creates a ‘Books’ menu item for free!
To create an about page on my site and have it accessible via the menu, all I had to do was add an about.md
markdown file in the root directory and Jekyll did everything else.
UPDATE 2018: Github now has support for https on custom domains. Just include a file named ‘CNAME’ with your custom domain and update your DNS.
Currently my Jekyll site is reachable from hadji.co
or www.hadji.co
via URL forwarding set up in my DNS. On Github Pages I can have the site show up with my custom url by including a CNAME
file in my github repository. I’ve been debating the merits of that since I lose the https functionality that is available for free with my github account
In other words, I can have my url show up as:
https://antonioshadji.github.io/
or
http://www.hadji.co/
Currently, Github does not offer https
on custom domains. I’m assuming that it is only a matter of time before they do. There are people writing about how to use cloudflare to make the site appear on https
urls. My understanding is that this isn’t the same as having the domain secured with ssl. Since it’s not the same, I prefer to not make it appear so to visitors.
I’m choosing to continue using my github.io
address. I recently found some information on Moz.com that helped me make the decision.
What caught my attention is the distinction between what happens when I use a 301 redirect vs. what happens with <link rel=canonical ...
meta data.
If I add a canonical url to my content in Jekyll on Github Pages the search engines will get the same redirection information that they would get with a 301 redirect. The only difference is that users will always see Github Pages site even if the content is living elsewhere on the net someday. I’m only concerned about controlling my SEO score and this gives me that ability. If you think I’m missing something here please let me know in the comments.
This was also confirmed by Yoast.
If you have read all the way to here, I hope that you found this information useful. I have many plans for this site and all my Jekyll modifications will be documented in this post. For your enjoyment and so that I can remember what I have done to modify my site from the default install.
]]>