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
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
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"); |
/* | |
* 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 |
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 |
Open console.
localStorage.setItem("twilight.theme", 1);
Reload.
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 |
https://codesandbox.io/s/o5r159mpkq |
const fs = require("fs"); | |
const path = require ("path"); | |
const readline = require('readline'); | |
const { spawn } = require('child_process'); | |
let ROMS_FOLDER = "C:/Users/.../PSX"; | |
let MEDNAFEN_HOME = "C:/Users/.../Mednafen"; | |
// Initialize the line reader | |
const rl = readline.createInterface({ |
// normalizeTitle :: String -> String | |
const normalizeTitle = rawTitle => { | |
const parts = rawTitle.split(" - "); | |
const right = parts[1].toLowerCase().replace(/\s/g, "_").replace(/[^a-z_0-9]+/g, ""); | |
return `${parts[0]}-${right}`; | |
} | |
const rawTitle = document.getElementById("problem-name").innerHTML; |