burkeholland commited on
Commit
b870fcf
1 Parent(s): 81c0328

Upload 2 files

Browse files
Files changed (2) hide show
  1. bulma.txt +222 -0
  2. weather.txt +199 -0
bulma.txt ADDED
@@ -0,0 +1,222 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Disclaimer: This article is mostly satire. I do not think that I am better than you because I once wrote some TypeScript nor do I think that it’s a good thing for us to make web pages bigger. Feel free to misrepresent these views to maximize clicks.
2
+
3
+ You know, there are a lot of articles out there telling you how to make your page smaller: optimize your images, remove extraneous CSS rules, re-write the whole thing in Dreamweaver using framesets. Look,  Walmart just reduced their page size by some numbers, give or take.
4
+
5
+
6
+ What we don’t have are enough articles showing you how to increase your page size. In fact, the only article I could find was this one from the Geek Squad which ended up being about making the font size bigger. This is a good start, but I think we can do better.
7
+
8
+
9
+ Put on some weight
10
+ Now, why would you want to increase your page size? Isn’t that a not-very-nice thing for people on low bandwidth connections? Well, there are several excellent and in no-way-contrived reasons and here are three of them since things that come in threes are more satisfying.
11
+
12
+ You have a gigabit connection and you live in Tennessee so surely everyone else is in better shape than you are.
13
+ Browsers do caching, silly. That means that you only have to download the site once. Stop complaining. First world problems.
14
+ You don’t care whether or not people ever visit your site because you, “work to live, not live to work.”
15
+ If any of those completely relatable reasons resonates with you, I’d like to show you how I increased the size of my CSS by 1,500% — and you can too, with one simple webpack trick.
16
+
17
+ One weird trick
18
+ It all started when I decided to refactor my retirement plan project called The Urlist over to the Bulma CSS framework.
19
+
20
+
21
+ The original incarnation of the site was all hand-rolled and my Sass looked like an episode of Hoarders.
22
+
23
+ “Burke, you don’t need 13 different .button styles. Why don’t you pick one and we can get rid of these other 12 so you have somewhere to sleep?”
24
+
25
+ Bulma also includes things like modals that I used third-party Vue components to make.
26
+
27
+
28
+ It also has a hamburger menu because it’s a well-known scientific fact that you cannot have a successful site without a hamburger.
29
+
30
+
31
+ Look, I don’t make the rules. This is just how business works.
32
+
33
+
34
+ I was quite happy with the result. Bulma styles are sharp, and the layout system is easy to learn. It’s almost as if someone somewhere understands CSS and also doesn’t hate me. That’s just a hard combination to find these days.
35
+
36
+ After a few weeks of refactoring (during which I would ask myself, “WHAT ARE YOU EVEN DOING MAN?!? THE SITE ALREADY WORKS!”), I finally finished. As a side note, the next time you think about refactoring something, don’t. Just leave it alone. If you don’t leave any technical debt for the next generation, they’re going to be extremely bored and that’s going to be on you.
37
+
38
+ When I built the project, I noticed something odd: the size of my CSS had gone up pretty significantly. My hand-crafted abomination was only 30KB gzipped and I was up to 260KB after the refactor.
39
+
40
+
41
+ And, to make matters worse, the Vue CLI was lecturing me about it…
42
+
43
+
44
+ Which, of course, I ignored. I don’t take instructions from robots.
45
+
46
+ What I did instead was deploy it. To production. On the internet. Because I did not spend all of this time refactoring to not deploy it. Yeah, sunk costs and all that, but excuse me if I’m more pragmatic than your poster of logical fallacies. All I’m saying is I came to party and I was not going home without a buzz.
47
+
48
+ Then I took to Twitter to announce my accomplishment to the ambivalent masses. As one does.
49
+
50
+
51
+ Shortly thereafter, Jeremy Thomas, who created Bulma (and clearly loves Dragon Ball) responded. It was quick, too. It’s like there is a bat signal that goes out whenever a moron tweets.
52
+
53
+
54
+ Duplicate styles? 13 times? What the heck is a namespace? Is that a π symbol or a custom Jeremy Thomas logo?
55
+
56
+ It’s at this moment that I realized that I have no idea what I’m doing.
57
+
58
+ Put the Sass down and back away slowly
59
+ I’ll be the first to admit that I don’t know a lot about CSS, and even Less about Sass. Get it? Less about Sass? Forget it. I don’t want your pity laugh.
60
+
61
+ When I setup my Vue CLI project to use Bulma, I created a src/styles folder and dropped in a bulma-but-not-all-of-bulma-only-some-of-it.scss file. They say naming things is hard, but I don’t see why.
62
+
63
+ That file imports the pieces of Bulma that I want to use. It’s Bulma, but not all of it. Only some of it.
64
+
65
+ @import "bulma/sass/utilities/_all.sass";
66
+ @import "bulma/sass/base/_all.sass";
67
+
68
+ @import "bulma/sass/form/shared.sass";
69
+ @import "bulma/sass/form/input-textarea.sass";
70
+
71
+ // etc...
72
+ Then I imported that file into a custom Sass file which I called… site.scss. I like to keep things simple.
73
+
74
+ @import "./bulma-but-not-all-of-bulma-only-some-of-it.scss";
75
+
76
+ html,
77
+ body {
78
+ background-color: #f9fafc;
79
+ }
80
+
81
+ // etc...
82
+ I wanted to import these files into Vue globally so that I could use them in every component. And I wanted to do it the right way; the canonical way. I think it’s clear from my willingness to deploy 2+ MB of CSS into production that I like to do things the “right way”.
83
+
84
+ I read this excellent blog post from Sarah Drasner called, “How to import a Sass file into every component in your Vue app.” She shows how to do it by modifying the webpack build process via the vue.config.js file.
85
+
86
+ module.exports = {
87
+ css: {
88
+ loaderOptions: {
89
+ sass: {
90
+ data: `@import "@/styles/site.scss";`
91
+ }
92
+ }
93
+ }
94
+ }
95
+ What I did not understand is that this imports Sass into every component in a Vue app. You know, like the title of the blog post literally says. This is also how I ended up with a bunch of duplicate styles that had a data-v- attribute selector on them. I have scoped styles to thank for that.
96
+
97
+ How Vue handles `scoped`
98
+ Vue allows you to “scope” styles to a component. This means that a style only affects the component that it’s in, and not the rest of the page. There is no magic browser API that does this. Vue pulls it off by dynamically inserting a data- attribute in both the element and the selector. For example, this:
99
+
100
+ <template>
101
+ <button class="submit">Submit</button>
102
+ <template>
103
+
104
+ <style lang="scss" scoped>
105
+ .submit {
106
+ background-color: #20ae96;
107
+ }
108
+ </style>
109
+ …becomes this:
110
+
111
+ <button class="submit" data-v-2929>Submit</button>
112
+
113
+ <style>
114
+ .submit[data-v-2929] {
115
+ background-color: #20ae96;
116
+ }
117
+ </style>
118
+ That dynamic data tag gets added to every child element in the component as well. So every element and every style for this component will have a data-v-2929 on them at runtime.
119
+
120
+ If you import a Sass file into your component that has actual styles in it, Vue (via webpack) will pull in those styles and “namespace” them with that dynamic data- attribute. The result is that is you include Bulma in your app 13 damn times with a bunch of data-v weirdness in front of it.
121
+
122
+ But this begs the question: if webpack renders the CSS in every single component, why would you ever want to use the vue.config.js approach? In a word: variables.
123
+
124
+ The variable sharing problem
125
+ You can’t define a Sass variable in one component and reference it from another. That would also be kind of hard to manage since you would be defining and using variables all over the place. Only I would write code like that.
126
+
127
+ You, on the other hand, would probably put all your variables in a variables.scss file. Each component would then reference that central store of variables. Importing a variables file into every single component is redundant. It’s also excessive. And unnecessary. And long-winded.
128
+
129
+ This is precisely the problem that Sarah’s article is solving: importing a Sass file into every component in your project.
130
+
131
+ It’s OK to import something like variables into every component because variables aren’t rendered. If you import 200 variables and only reference one of them, who cares? Those variables don’t exist in the rendered CSS anyway.
132
+
133
+ For example, this:
134
+
135
+ <style lang="scss" scoped>
136
+ $primary: #20ae96;
137
+ $secondary: #336699;
138
+
139
+ .submit {
140
+ background-color: $primary
141
+ }
142
+ </style>
143
+ …becomes this:
144
+
145
+ <style>
146
+ .submit[data-v-2929] {
147
+ background-color: #20ae96;
148
+ }
149
+ </style>
150
+ So, there are really two problems here:
151
+
152
+ Bulma needs to be global.
153
+ Bulma’s variables should be accessible from the components.
154
+ What we need is a clever combination of Sarah’s technique, along with a little proprietary knowledge about how Bulma is structured.
155
+
156
+ Using Bulma with the Vue
157
+ We’re going to accomplish this with the least amount of duplication by having three files in the src/styles directory:
158
+
159
+ variables.scss: This file will be where you pull in Bulma’s variables and override/define your own. Note that you have to include the following three files to get all of Bulma’s variables. And they have to be in this order…
160
+
161
+ // Your variables customizations go up here
162
+
163
+ // Include Bulma's variables
164
+ @import "bulma/sass/utilities/initial-variables.sass";
165
+ @import "bulma/sass/utilities/functions.sass";
166
+ @import "bulma/sass/utilities/derived-variables.sass";
167
+ bulma-custom.scss: This file is where you pull in the pieces of Bulma that you want. It should reference the variables.scss file.
168
+
169
+ @import "./variables.scss";
170
+
171
+ /* UTILTIES */
172
+ @import "bulma/sass/utilities/animations.sass";
173
+ @import "bulma/sass/utilities/controls.sass";
174
+ @import "bulma/sass/utilities/mixins.sass";
175
+
176
+ // etc...
177
+ site.scss: This pulls in the bulma-custom.scss file and is also where you define global styles that are used across the whole project.
178
+
179
+ @import url("https://use.fontawesome.com/releases/v5.6.3/css/all.css");
180
+ @import "./bulma-custom.scss";
181
+
182
+ html,
183
+ body {
184
+ height: 100%;
185
+ background-color: #f9fafc;
186
+ }
187
+
188
+ // etc...
189
+ Import the site.scss file into your main.js file. Or in my case, main.ts. Does it make me better than you that I use TypeScript? Yes. Yes it does.
190
+
191
+ import Vue from "vue";
192
+ import App from "./App.vue";
193
+ import router from "./router";
194
+
195
+ // import styles
196
+ import "@/styles/site.scss";
197
+ This makes all of the Bulma pieces we are using available in every component. They are global, but only included once.
198
+
199
+ Per Sarah’s article, add the variables.scss file to the vue.config.js file.
200
+
201
+ module.exports = {
202
+ css: {
203
+ loaderOptions: {
204
+ sass: {
205
+ data: `@import "@/styles/variables.scss";`
206
+ }
207
+ }
208
+ }
209
+ }
210
+ This makes it so that you can reference any of the Bulma variables or your own from any .vue component.
211
+
212
+ Now you have the best of both worlds: Bulma is available globally and you still have access to all Bulma variables in every component.
213
+
214
+ Total size of CSS now? About 1,500% smaller…
215
+
216
+
217
+ Take that, Walmart.
218
+
219
+ Redemption via PR
220
+ In an effort to redeem myself, I’ve submitted a PR to the Bulma docs that walks through how to customize Bulma in a Vue CLI project. It’s an act of contrition for taking to Twitter and making Bulma seem like the problem when really Burke is the problem.
221
+
222
+ And you would think that by now I would have this figured out: Burke is always the problem.
weather.txt ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ I like to jog. Sometimes it’s cold out. Sometimes it’s cold out, but it looks like it isn’t. The sun is shining, the birds are chirping. Then you step outside in shorts and a t-shirt and realize you have roughly 2 minutes before exposure sets in.
2
+
3
+ I decided to solve this first world problem using a lightbulb to display a certain color based on what the temperature outside is. It works better than I expected, and that’s saying something because usually nothing works out like I want it to.
4
+
5
+
6
+
7
+
8
+ This was a fun project to build, and since it is essentially a hosted service running on a timer, it’s a perfect use case for Serverless.
9
+
10
+ Now you might be thinking, “um, wouldn’t it be easier to just check the weather?” Well, it would, but then I wouldn’t have an excuse to buy an expensive lightbulb or write an article with the word “Serverless.”
11
+
12
+ So let’s look at how you can build your own Weather Bulb. The final code is not complicated, but it does have some interesting pieces that are worth noting. By the way, did I mention that it’s Serverless?
13
+
14
+ Building the Weather Bulb
15
+ The first thing you are going to need is the bulb. You can’t have a Weather Bulb sans bulb. Say the word “bulb” out loud about 10 times and you’ll notice what a bizarre word it is. Bulb, bulb, bulb, bulb — see? Weird.
16
+
17
+ I am using the LIFX Mini Color. It’s not *too* expensive, but more importantly, it’s got an API that is wide open.
18
+
19
+
20
+ The API has two methods of authentication. The first contains the word “OAuth” and I’m already sorry that you had to read that. Don’t worry, there is an easier way that doesn’t involve OAu…. that which won’t be named.
21
+
22
+ The second way is to register an application with LIFX. You get back a key and all you have to do is pass that key with any HTTP request. That’s what I’m using for this demo.
23
+
24
+ For instance, if we wanted to change the bulb color to blue, we can just pass color: blue to the /state endpoint.
25
+
26
+
27
+ The API supports a few different color formats, including named colors (like red, blue), hex values, RBG, Kevlin, hue brightness and saturation. This is important because it factors into what proved to be the hardest part of this project: turning temperature into color.
28
+
29
+ Representing Temperature With Color
30
+ If you’ve ever watched a weather report, you’ll be familiar with the way that meteorology represents weather conditions with color on a map.
31
+
32
+
33
+ Usually, this is done to visualize precipitation. You have probably seen that ominous green strip of storms bearing down on you on a weather map while you try to figure out if you should get in the bathtub because you’re in the path of a tornado. Or maybe that’s just all of us unlucky souls here in America’s Tornado Alley.
34
+
35
+ Color is also used to represent temperature. This is precisely what I wanted to do with the bulb. The tough thing is that there doesn’t seem to be a standardized way to do this. Some maps show it as solid colors in bands. In this case, blue might represent the band from 0℉ – 32℉.
36
+
37
+
38
+ Others have it as a gradient scale which is more precise. This is what I was after for the Weather Bulb.
39
+
40
+
41
+ My first stab at solving this was just to Google “temperature color scale” and other various iterations of that search term. I got back a lot of information about Kelvin.
42
+
43
+ Kelvin is a representation of the temperature of a color. Literally. For any light source (light bulb, the sun, ect) the actual temperature of that source will affect the color of the light it emits. A fire burns a yellowish red color. The hotter that fire gets, the more it moves towards white. Hence the saying, “white hot”. So if someone ever says “red hot,” you can correct them in front of everyone because who doesn’t love a pedantic jerk?
44
+
45
+ The LIFX bulb supports Kelvin, so you might think that this would work. After all, this is the Kelvin scale….
46
+
47
+
48
+ The problem is that there is simply not enough color variation because these are not actual colors, but rather the tinge of color that a light is emitting based on it’s “temperature.” Here is the Kelvin color wheel that comes with the LIFX app.
49
+
50
+
51
+ These colors are barely distinguishable from one another on the bulb. Not exactly what I was after.
52
+
53
+ That leaves me with trying to convert the color to either Hex, RGB or some other format. This is tough because where do you begin? I spent an embarrassing amount of time adjust RGB scale values between blue for cold (0, 0, 255) and red for hot (255, 0, 0). It was about this time that it dawned on me that maybe HSL would be a better way to go here. Why? Because hue is a whole lot easier to understand.
54
+
55
+ Hue
56
+ Hue is a representation of color on a scale between 0 and 360. This is why we often see color represented on a wheel (360°). That’s a vast oversimplification, but unless you want me to start talking about wavelengths, let’s go with that definition.
57
+
58
+ The hue color wheel looks like this….
59
+
60
+
61
+ If we flatten it out, it’s easier to reason about.
62
+
63
+
64
+ We’re ready to convert temperature to color. The first thing we need to do is figure out a set temperature range. I went with 0℉ to 100℉. We can’t work with infinite temperature color combinations. Numbers go on forever, colors do not. It can only get so hot before our bulb is just bright red all the time, and that’s 100℉. The same is true for cold.
65
+
66
+ If light blue represents 0℉, I can start at about the 200 mark on the hue scale. Red will represent 100℉. You can see that red is at both extremes, so I can move either left OR right, depending on what colors I want to use to represent the temperature. It’s not the same as the colors they use in actual weather programs, but who cares? Obviously not me.
67
+
68
+ I chose to go right because there is no pink on the left and pink is my favorite color. I also felt like pink represents warm a bit better than green. Green is rain and tornadoes.
69
+
70
+ Now we can back into a hue based on temperature. Ready? Here we go.
71
+
72
+ Let’s pretend it’s a brisk 50℉ outside.
73
+
74
+ If 100℉ is the hottest we go (360) and 0℉ is the coldest (200), then we have a color scale of 160 points. To figure out where in that 160 point range we need to be, we can divide the current temperature by the upper bound of 100℉ which will give us the exact percentage we need to move in our range, or 50%. If we move 50% of the way into a 160 point range, that leaves us at 80. Since we are starting at 200, that gives us a hue of 280.
75
+
76
+ That sounds complicated, but only because word problems in math SUCK. Here’s how the code looks when it’s all said and done…
77
+
78
+ let hue = 200 + (160 * ( temperature / 100 ));
79
+ OK! We’ve got a dynamic color scale based on hue, and wouldn’t you know it, we can just pass the hue to LIFX as simply as we pass a named color.
80
+
81
+
82
+ Now we just need to find out what the current temperature is, back into a hue and do that every few minutes. Serverless, here we come!
83
+
84
+ Serverless Timer Functions
85
+ Serverless is all the rage. It’s like HTML5 used to be: it doesn’t matter what it is, it only matters that you know the word and are not afraid to use it in a blog post.
86
+
87
+ For this example, we’ll use Azure Functions because there is support for timer triggers, and we can test those timer triggers locally before we deploy using VS Code. One of the things about Serverless that irritates me to no end is when I can’t debug it locally.
88
+
89
+ Using the Azure Functions Core Tools and the Azure Functions Extension for VS Code, I can create a new Serverless project and select a Timer Trigger.
90
+
91
+
92
+ Timer Triggers in Azure Functions are specified as Cron Expressions. Don’t worry, I didn’t know what that was either.
93
+
94
+ Cron Expressions allow you to get very specific with interval definition. Cron breaks things down into second, minute, hour, day, month, year. So if you wanted to run something every second of every minute of every hour of every day of every year, your expression would look like this…
95
+
96
+ * * * * * *
97
+ If you wanted to run it every day at 10:15, it would look like this…
98
+
99
+ * 15 10 * * *
100
+ If you wanted to run it every 5 minutes (which is what Azure defaults to), you specify that by saying “when minutes is divisible by 5.”
101
+
102
+ 0 */5 * * * *
103
+ For the purposes of this function, we set it to 2 minutes.
104
+
105
+
106
+ I am using a 2 minute interval because that’s how often we can call the weather API for free 💰.
107
+
108
+ Getting the Forecast From DarkSky
109
+ DarkSky has a wonderful weather API that you can call up to 1,000 times per day for free. If there are 1,440 minutes in a day (and there are), that means we can call DarkSky every 1.44 minutes per day and stay in the free zone. I just rounded up to 2 minutes because temperature doesn’t change that fast.
110
+
111
+ This is what our function looks like when we call the DarkSky API. All of my tokens, keys, latitude and longitude settings are in environment variables so they aren’t hardcoded. Those are set in the local.settings.json file. I used axios for my HTTP requests because it is a magical, magical package.
112
+
113
+ const axios = require('axios');
114
+
115
+ module.exports = function (context, myTimer) {
116
+ // build up the DarkSky endpoint
117
+ let endpoint = `${process.env.DS_API}/${process.env.DS_SECRET}/${process.env.LAT},
118
+ ${process.env.LNG}`;
119
+
120
+ // use axios to call DarkSky for weather
121
+ axios
122
+ .get(endpoint)
123
+ .then(response => {
124
+ let temp = Math.round(response.data.currently.temperature);
125
+
126
+ // TODO: Set the color of the LIFX bulb
127
+ })
128
+ .catch(err => {
129
+ context.log(err.message);
130
+ });
131
+ };
132
+ Now that I have the temperature, I need to call the LIFX API. And wouldn’t you know it, someone has already created an npm package to do this called lifx-http-api. This is why you love JavaScript.
133
+
134
+ Setting the Bulb Hue
135
+ After the weather result comes back, I need to use the LIFX API instance and call the setState method. This method returns a promise which means that we need to nest promises. Nesting promises can get out of hand and could land us right back in callback hell, which is what we’re trying to avoid with promises in the first place.
136
+
137
+ Instead, we’ll handle the first promise and then return Promise.all which we can handle at another top-level then. This just prevents us from nesting then statements.
138
+
139
+ Remember kids, promises are just socially acceptable callbacks.
140
+
141
+ const axios = require('axios');
142
+ const LIFX = require('lifx-http-api');
143
+
144
+ let client = new LIFX({
145
+ bearerToken: process.env.LIFX_TOKEN
146
+ });
147
+
148
+ module.exports = function (context, myTimer) {
149
+ // build up the DarkSky endpoint
150
+ let endpoint = <code>${process.env.DS_API}/${process.env.DS_SECRET}/${
151
+ process.env.LAT
152
+ },${process.env.LNG}<code>;
153
+
154
+ // use axios to call DarkSky for weather
155
+ axios
156
+ .get(endpoint)
157
+ .then(response => {
158
+ let temp = Math.round(response.data.currently.temperature);
159
+
160
+ // make sure the temp isn't above 100 because that's as high as we can go
161
+ temp = temp < 100 ? temp : 100;
162
+
163
+ // determine the hue
164
+ let hue = 200 + (160 * (temp / 100));
165
+
166
+ // return Promise.all so we can resolve at the top level
167
+ return Promise.all([
168
+ data,
169
+ client.setState('all', { color: <code>hue:${hue}<code> })
170
+ ]);
171
+ })
172
+ .then(result => {
173
+ // result[0] contains the darksky result
174
+ // result[1] contains the LIFX result
175
+ context.log(result[1]);
176
+ })
177
+ .catch(err => {
178
+ context.log(err.message);
179
+ });
180
+ };
181
+ Now we can run this thing locally and watch our timer do it’s thang.
182
+
183
+
184
+ That’s it! Let’s deploy it.
185
+
186
+ Deploying Weather Bulb
187
+ I can create a new Functions project from the VS Code extension.
188
+
189
+
190
+ I can right-click that to “Open in portal” where I can define a deployment source so it sucks my code in from Github and deploys it. This is ideal because now whenever I push a change to Github, my application automatically gets redeployed.
191
+
192
+
193
+ All Hail the Weather Bulb
194
+ Now just sit back and behold the soft glow of the Weather Bulb! Why look at the actual temperature when you can look at this beautiful shade of hot pink instead?
195
+
196
+ Can you guess what the temperature is based on what you know from this article? The person who leaves a comment and gets the closest will get a free LIFX lightbulb from me (because I ❤️ all of you), or the cost of the bulb if you are outside the U.S. (~$40).
197
+
198
+
199
+ You can grab all of the code for this project from Github.