- Install sonarqube-scanner
npm install --save-dev sonarqube-scanner sonarqube-verify jest-sonar
- Create configuration for project:
sonar-project.properties
sonar.projectKey=secure-typescript-boilerplate
// A parser for things | |
// Is a function from strings | |
// To lists of pairs | |
// Of things and strings | |
// (c) Graham Hutton | |
const skip = (parser) => (text) => { | |
const parsed = parser(text); | |
if (parsed.length === 0) { | |
return parsed; |
const mkQueue = (sameTimeCount, delay, maxRepeats) => { | |
const queued = []; | |
const inWork = []; | |
const removeFromInWork = (frr) => { | |
const i = inWork.indexOf(frr); | |
inWork.splice(i, 1); | |
if (inWork.length < sameTimeCount && queued.length > 0) { | |
const [newFrr] = queued.splice(0, 1); | |
// eslint-disable-next-line no-use-before-define | |
addToInWork(newFrr); |
{-# OPTIONS_GHC -O2 -threaded #-} | |
{-# LANGUAGE BangPatterns #-} | |
module Main where | |
import Control.Monad (forM_) | |
import Control.Monad.ST | |
import Data.Array (Array, array, listArray, (!)) | |
import Data.Array.ST | |
lcs :: (Eq a) => [a] -> [a] -> Int |
As I promised here is the recipe for syrniks.
In case I just don't know the name for something in English that I can just buy, tell me, please. I'm too lazy to do something I don't need to do.
You need:
-- to add colors like dark-green or dark\ngreen in this algorithm you need to add each different phrase | |
-- as sparate phrase or to modify AhoCorassick to use wildcards. It's possible and even easy to do it. | |
-- But you need to change package. | |
module Main where | |
import Data.Char (isAlphaNum) | |
import Data.List.Split (splitOn) | |
import qualified Data.Map as M | |
import System.Environment | |
import System.IO |
// https://medium.com/javascript-in-plain-english/interviewing-at-google-javascript-assessment-questions-f9bf0c0df157 | |
// Utils. | |
const generateWord = k => l => 'a'.repeat(l).split('').map(_ => k[Math.round(Math.random() * k.length + .5)]).join(''); | |
// Exercise 1. | |
const collectFruits = bins => trees => { | |
let btypes = new Set(), fruits = [], collected = 0; | |
for (let i = 0; i < trees.length; i++) { | |
if (btypes.size < bins) { |
{-| | |
Here is examples from these lectures: | |
https://www.youtube.com/watch?v=PAqzQMzsUU8 | |
https://www.youtube.com/watch?v=jpl7FE2TZTE | |
Also a great article is here: | |
https://www.schoolofhaskell.com/user/bartosz/understanding-algebras | |
I just wrote down examples from lectures as accurate as I could. | |
As I feel it, playing with this code allow to understand lectures better and to find why and where you need this. | |
This code available here: | |
https://gist.github.com/DKurilo/5e5563f4c2a8e8ca53a7b98ebf59e9f1 |
:set prompt "\ESC[1;34m\x03BB> \ESC[m" | |
:set prompt-cont "\ESC[1;34m > \ESC[m" | |
:seti -XGADTSyntax | |
:seti -XGeneralizedNewtypeDeriving | |
:seti -XInstanceSigs | |
:seti -XLambdaCase | |
:seti -XPartialTypeSignatures | |
:seti -XScopedTypeVariables | |
:seti -XTypeApplications | |
:seti -XOverloadedStrings |
" https://github.com/neoclide/coc.nvim#example-vim-configuration | |
set hidden | |
set cmdheight=2 | |
set shortmess+=c | |
" This is only necessary if you use "set termguicolors". | |
set termguicolors | |
" Coc.nvim | |
" Some servers have issues with backup files, see #649. | |
set nobackup |