In addition to the Storybook for React setup, you'll also need to install these packages:
npm i -D @babel/core babel-loader css-loader style-loader
function solution(N) { | |
const binary = N.toString(2); | |
let gaps = []; | |
let count = 0; | |
for(let b of binary) { | |
if(b === "0") { | |
count++ | |
} else { | |
gaps.push(count); | |
count = 0 |
In addition to the Storybook for React setup, you'll also need to install these packages:
npm i -D @babel/core babel-loader css-loader style-loader
{"lastUpload":"2019-08-06T02:46:34.859Z","extensionVersion":"v3.4.1"} |
If you have already seen Richard Feldman's talk entitled "Making Impossible States Impossible" or have read "Designing with types: Making illegal states unrepresentable" then you can skip the explanations and just head straight to the Reason examples.
This post is intended to display how to model your Reason Application to prevent creating impossible states. The benefits of being able to design a feature in this way include avoiding having to deal with complex test scenarios regarding defined business rules and a clear documentation of what is possible just by looking at the type definition. Long story short, let's see how this all works by implementing an example.
This is a basic guide on how to learn Elm rather than actually teach you. I'm going to mostly link to resources that I feel are valuable and try to "teach you how to fish".
The main purpose is to accelerate your learning and save you a lot of googling and weeding through bad explinations.
* what it's like to not be technical in the industry | |
* what you do in tech that people forget is needed | |
* the most interesting thing you've worked on recently | |
* what your day-to-day is like | |
* must-have gifs for every techie | |
* horrible code from the past that shows I'm much better now | |
* the best music for hacking | |
* mistakes you've made that make you groan | |
* how you've made it at well-known companies | |
* self-care in the tech bubble |
/** | |
* Using Operator Mono in Atom | |
* | |
* 1. Open up Atom Preferences. | |
* 2. Click the “Open Config Folder” button. | |
* 3. In the new window’s tree view on the left you should see a file called “styles.less”. Open that up. | |
* 4. Copy and paste the CSS below into that file. As long as you have Operator Mono SSm installed you should be golden! | |
* 5. Tweak away. | |
* | |
* Theme from the screenshot (http://cdn.typography.com/assets/images/blog/operator_ide2.png): |
// | |
// hasPosition trait | |
// | |
const hasPosition = state => ({ | |
setPosition: function(x, y) { | |
this.x = x; | |
this.y = y; | |
}.bind(state) | |
}); |
@ECHO OFF | |
SETLOCAL | |
GOTO:MAIN | |
REM | |
REM Info functions start | |
REM | |
REM Display version and copyright information | |
:VERSION |