Open console.
localStorage.setItem("twilight.theme", 1);
Reload.
https://codesandbox.io/s/o5r159mpkq |
function toParagraphs(string){ | |
return string.split(/[\r?\n]+/g) | |
.map(p => p.trim()) | |
.filter(p => p.length > 0) | |
.map(p => `<p>${p}</p>`) | |
.join(""); | |
} | |
// Tests |
Open console.
localStorage.setItem("twilight.theme", 1);
Reload.
require 'test/unit' | |
extend Test::Unit::Assertions | |
# Comprimir rangos | |
# [1,2,3,7,8,9,10] => [[1,3], [7,10]] | |
# Diferencia de rangos | |
# Se tienen dos listas que se restan A - B | |
# A = [[1, 100], [200, 500]] esto significa que hay dos rangos 1→100 y 200→500 | |
# B = [[50, 70], [150, 300]] representa lo mismo que lo anterior |
/* | |
* Dada una cadena de ADN (ej: GATACGATCGTACGAT) detectar en tiempo O(n) si una subcadena (ej: GACA) esta contenida. | |
* | |
*/ | |
valores = { | |
A: 1, | |
C: 2, | |
G: 3, | |
T: 4 |
function dots(number, separator = '.') { | |
return number.toString().replace(/\B(?=(\d{3})+(?!\d))/g, separator); | |
} | |
// Positive tests | |
console.assert(dots(0) === "0"); | |
console.assert(dots(1) === "1"); | |
console.assert(dots(12) === "12"); | |
console.assert(dots(123) === "123"); |
I have a heavy grunt setup, so when I'm only working on the backend, I run the app with this command
npm run gruntless
Here's how to make it:
app.js