<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Blog by John Beynon]]></title><description><![CDATA[Web developer by day. Father, techie, sailor the rest of the time.]]></description><link>https://johnb.dev</link><generator>GatsbyJS</generator><lastBuildDate>Fri, 09 Apr 2021 13:41:10 GMT</lastBuildDate><item><title><![CDATA[Let's Talk about DevContainers (Part1)]]></title><description><![CDATA[This article introduces VS Code DevContainers and finally completes my jigsaw of using Docker for local development.]]></description><link>https://johnb.devlets-talk-about-devcontainers-part1</link><guid isPermaLink="false">https://johnb.devlets-talk-about-devcontainers-part1</guid><pubDate>Thu, 08 Apr 2021 09:34:14 GMT</pubDate><content:encoded>&lt;p&gt;I’ve had a love hate relationship with Docker over the years, I’ve really struggled to make it fit in to my development flow. Now I know it’s just me because I see plenty of folks using Docker for development but it just never clicked for me. There’s always been a disconnect.&lt;/p&gt;
&lt;p&gt;Until I found DevContainers in VS Code. First up, let’s caveat this. What I’m going to talk about in this entire article is possible without going near VS Code, VS Code is the final piece in my jigsaw and hopefully by the end you’re going to understand why.&lt;/p&gt;
&lt;p&gt;I’ve experimented my fair share with Docker using a Dockerfile in my projects and Docker Compose - I’ve just assumed I should be able to type &lt;code class=&quot;language-text&quot;&gt;docker-compose up&lt;/code&gt; in my terminal and in a few minutes I’d have a working local version of my app complete with all it’s dependencies, seed data presented to me.&lt;/p&gt;
&lt;h2 id=&quot;so-how-are-devcontainers-different&quot; style=&quot;position:relative;&quot;&gt;&lt;a href=&quot;#so-how-are-devcontainers-different&quot; aria-label=&quot;so how are devcontainers different permalink&quot; class=&quot;anchor before&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; focusable=&quot;false&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;So how are DevContainers different?&lt;/h2&gt;
&lt;p&gt;What if, instead of trying to setup the entire application with one command, what if you didn’t do any of that and just booted an environment where you can write and execute your code locally? Enter Dev Containers. Simply put, a development container is just for the project you are working on - whether it be Ruby, Node, Go etc etc - no more installing of whatever you need locally, have it all in the container and safely stored in source control. What’s even better is that VS Code detects your app has a devcontainer config and boots it up and then closes it down when your done for that particular project. This is SUPER handy when coming onto a project for the first time - I mean, seriously, who actually reads READMEs?&lt;/p&gt;
&lt;p&gt;When your project is opened in the container the magic happens (I’m not intending to go through the ins and outs of it here). But, what you end up with is your local VS Code running with your application code, opening terminal inside VSCode opens a terminal to the container. Running your application inside the container, eg with &lt;code class=&quot;language-text&quot;&gt;rails server&lt;/code&gt; runs your application within the container that is then accessible by your local browser. It’s almost entirely invisible that you’re running in a container - assuming Docker run’s fine on your computer of course!&lt;/p&gt;
&lt;h2 id=&quot;so-how-do-you-do-it&quot; style=&quot;position:relative;&quot;&gt;&lt;a href=&quot;#so-how-do-you-do-it&quot; aria-label=&quot;so how do you do it permalink&quot; class=&quot;anchor before&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; focusable=&quot;false&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;So how do you do it?&lt;/h2&gt;
&lt;p&gt;Well there’s a few requirements as you’d expect:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;VS Code installed (obviously)&lt;/li&gt;
&lt;li&gt;Docker installed&lt;/li&gt;
&lt;li&gt;Remote Developer Extension installed in VS Code&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Once you’ve got these satisfied, open up the app in VS Code and from the bottom left corner of the VS Code interface click the green &gt;&amp;#x3C; icon and choose&lt;code class=&quot;language-text&quot;&gt;Remote-Containers: Add Developement Container Configuration files&lt;/code&gt;, VS Code will then offer you a bunch of premade environments to pick what your project needs. For example, picking Ruby a further prompt lets you pick the version and if you need Node.js available. A &lt;code class=&quot;language-text&quot;&gt;.devcontainer&lt;/code&gt; folder will be added to your project containing a &lt;code class=&quot;language-text&quot;&gt;devcontainer.json&lt;/code&gt; and a &lt;code class=&quot;language-text&quot;&gt;Dockerfile&lt;/code&gt; as well as VS Code now prompting you to open the app in the container. &lt;/p&gt;
&lt;p&gt;And that’s it. If it all went well you’ll be sitting in VS Code and it will look just like it always does. Opening a terminal within VS Code dumps you into the container a prompt that looks just like it would locally and git commands in the terminal just work.&lt;/p&gt;
&lt;p&gt;If it’s a Ruby app your next task is to run &lt;code class=&quot;language-text&quot;&gt;bundle&lt;/code&gt;, remember this is a clean environment. Ah, but it’s not found. Nevermind, open up the &lt;code class=&quot;language-text&quot;&gt;Dockerfile&lt;/code&gt; and you’ll see a commented out block for installing gems, add in the &lt;code class=&quot;language-text&quot;&gt;gem install bundler&lt;/code&gt;. Save the file, from the &gt;&amp;#x3C; icon, Rebuild container, wait, return to terminal - run &lt;code class=&quot;language-text&quot;&gt;bundle&lt;/code&gt; and you’re done.&lt;/p&gt;
&lt;h2 id=&quot;wrapping-up&quot; style=&quot;position:relative;&quot;&gt;&lt;a href=&quot;#wrapping-up&quot; aria-label=&quot;wrapping up permalink&quot; class=&quot;anchor before&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; focusable=&quot;false&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;Wrapping up&lt;/h2&gt;
&lt;p&gt;I said at the beginning I’d explain why it’s the last piece of the puzzle. Sure, this is entirely possible with &lt;code class=&quot;language-text&quot;&gt;docker exec -it &amp;lt;container name&amp;gt; /bin/bash&lt;/code&gt; - but then I’d have to remember that command each and every time (or use an alias). I can’t simply just open a new terminal window and be in my app, I have to run the docker command. The implementation of DevContainers abstracts it all away from me. Not convinved? Ok - come back next time and I’ll try and persuede you some more - there’s plenty more goodness with Dev Containers!&lt;/p&gt;
&lt;h2 id=&quot;next-time&quot; style=&quot;position:relative;&quot;&gt;&lt;a href=&quot;#next-time&quot; aria-label=&quot;next time permalink&quot; class=&quot;anchor before&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; focusable=&quot;false&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt; Next time&lt;/h2&gt;
&lt;p&gt;In my next article I’ll explore adding dependencies and customizing the VS Code workspace.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Update on the Casper Glow]]></title><description><![CDATA[An update on Casper Glow lights following a recent software update from Casper.]]></description><link>https://johnb.devupdate-on-the-casper-glow</link><guid isPermaLink="false">https://johnb.devupdate-on-the-casper-glow</guid><pubDate>Wed, 28 Aug 2019 10:54:27 GMT</pubDate><content:encoded>&lt;p&gt;One of the things that was REALLY annoying about the Casper Glow’s when they first launched was the inability to configure alarms with different repeat patterns, it was simply alarm ON/OFF - so at weekends you had to remember to turn the alarm off else you were waking up early. Ugh.&lt;/p&gt;
&lt;p&gt;Fortunately, the lovely folks at Casper heard/realised this need and have now given us the ability to configure ‘repeat’ for alarms, so we can have a Weekday alarm repeating on Monday to Friday safe in the knowledge that we won’t get woken unnecessarily at the weekend…&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/media/screenshot_20190828-115225.png&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/media/screenshot_20190828-115235.png&quot;&gt;&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Review: Casper Glow]]></title><description><![CDATA[A review of the new Casper Glow lights.]]></description><link>https://johnb.devreview-casper-glow</link><guid isPermaLink="false">https://johnb.devreview-casper-glow</guid><pubDate>Mon, 01 Apr 2019 18:37:25 GMT</pubDate><content:encoded>&lt;p&gt;I thought I’d start the reboot of my blogging (last blog post October 2013 - now archived!) with a review of the &lt;a href=&quot;https://casper.com/uk/en/glow-light/&quot;&gt;Casper Glow Lights&lt;/a&gt;  that we recently purchased. Yes, Casper the mattress company are branching out beyond selling mattresses into sleep related products and this is their first none bed related product available worldwide.&lt;/p&gt;
&lt;p&gt;We’ve been hunting for bedside lights for a while now so the release of these came at exactly the right time. We couldn’t decide between ourselves on a design that we wanted but the minimal, modern design of the Casper Glow immediately grabbed us. These things look fantastic I think, they’re not exactly ‘cheap’ but the TLDR of this is that they are worth it!&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/media/glow-gallery-1-double.jpg&quot; title=&quot;Casper Glow lights&quot;&gt;&lt;/p&gt;
&lt;p&gt;Let me explain how they work..&lt;/p&gt;
&lt;p&gt;There’s no up or down and there are no wires apart from the charging platform that they sit on. Flipping the device over turns the light on. Twisting the light dims it, and back the other way increases the brightness level. Once the light is on it then it starts dimming based on the configuration (more on that later). Should you wish to use the light for longer, then the top (or bottom) of the light can be pressed to ‘pause’ the dimming process and pressed again to unpause to gently prepare you to sleep.&lt;/p&gt;
&lt;p&gt;Should you need some light at night then picking up the light and giving it a little wiggle turns the light on with a low level of light that won’t suddenly blind you.&lt;/p&gt;
&lt;h2 id=&quot;the-app&quot; style=&quot;position:relative;&quot;&gt;&lt;a href=&quot;#the-app&quot; aria-label=&quot;the app permalink&quot; class=&quot;anchor before&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; focusable=&quot;false&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;The app&lt;/h2&gt;
&lt;p&gt;The app is available on iOS and Android and lets you configure the lights once they’ve been paired with whatever device you are using. It’s pretty simple, it lets you give each light a name when your pair it, toggle the light on/off by tapping the image of the light. You can edit the wake up time, group lights together and make changes to how long the dimming time is and the overall brightness. The app is also aware whether the light is on/off - more on that soon.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/media/718107d7-f260-49fc-836c-4116f10112d4.png&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;real-world-usage&quot; style=&quot;position:relative;&quot;&gt;&lt;a href=&quot;#real-world-usage&quot; aria-label=&quot;real world usage permalink&quot; class=&quot;anchor before&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; focusable=&quot;false&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;Real world usage&lt;/h2&gt;
&lt;p&gt;So all of this sounds nice but there must be more and there is. Waking up to a beeping alarm, radio etc isn’t ideal - you get jolted out of sleep and studies have shown it’s not a great way to start your day. The Casper Glow app lets you configure a wake up time - before which the brightness of the light will begin to build slowly so at the configured time the light is bright and in theory, has gently woken you up. Does it work? Yes! A week after having the lights at home we turned off our normal radio alarm clock in preference to the Glows.&lt;/p&gt;
&lt;p&gt;We initially bought a 2 pack but we’ll probably end up needing a few more. We’ve found that they’re super handy at bedtime for our kids. We can grab one of the lights from our room, flip it over and leave it in their room slowly dimming so they’ve got time to wind down, read a book or something else - not forgetting to grab them back for our own use! The best part is that we can see the light status when we’re downstairs - I’m not entirely sure of the range but it certainly works through our whole house. So if they mess with the light, pause it etc etc then we can see that and simply turn the light off or pay them a visit.&lt;/p&gt;
&lt;h2 id=&quot;theyre-not-without-their-flaws-though&quot; style=&quot;position:relative;&quot;&gt;&lt;a href=&quot;#theyre-not-without-their-flaws-though&quot; aria-label=&quot;theyre not without their flaws though permalink&quot; class=&quot;anchor before&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; focusable=&quot;false&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;They’re not without their flaws though…&lt;/h2&gt;
&lt;p&gt;There are definitely a few areas of improvement for Casper to make. In no particular order:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Different wake up schedules for weekdays/weekdays - right now you can only configure a single wake up time so unless you want to wake up at the same time at the weekend you have to remember to go into the app and turn the wake up off - and then back on a Monday.&lt;/li&gt;
&lt;li&gt;Right now it seems like you can only have the devices paired to a single phone/tablet - probably as they are Bluetooth powered. I have them paired to my phone but if I’m away on business my wife can’t then change the wake up time related to the issue above.&lt;/li&gt;
&lt;li&gt;I’d really like to be to optionally configure the delay time before the dimming process starts. So I could say, configure a 10 minute delay before a 30 minute dim starts - maybe the ability to configure the pause time is what I actually want?&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;in-closing&quot; style=&quot;position:relative;&quot;&gt;&lt;a href=&quot;#in-closing&quot; aria-label=&quot;in closing permalink&quot; class=&quot;anchor before&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; focusable=&quot;false&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;In closing&lt;/h2&gt;
&lt;p&gt;Would I recommend these? Absolutely. Philips make a similar wake up light product that’s priced similarly, cheaper options are available but at least the Glow is in the right ball park. If they iron out my littles niggles then they’ll be perfect!&lt;/p&gt;</content:encoded></item></channel></rss>