Skip to content

Instantly share code, notes, and snippets.

View micheleriva's full-sized avatar
🍄
Building Orama

Michele Riva micheleriva

🍄
Building Orama
View GitHub Profile
module.exports = function log(args) {
return process.stdout.write(`[${+ new Date()}] - ${args}\n`)
}
$ yarn init
$ yarn add -D forever
$ yarn add jimp koa koa-router
def f(num: Int, arr: List[Int]): List[Int] = arr.flatMap(e => List.fill(num)(e))
def f(arr: List[Int]): Int = arr.filter( _ % 2 != 0 ).sum
main :: IO ()
main = do putStrLn "Hello World!"
#include <iostream>
using namespace std;
int main(){
int input;
cin >> input;
for(int i = 0; i < input; i++){
import Control.Monad.State
main = do
cases <- readLn
forM [1..cases] $ \_ -> do
limit <- readLn
print $ sum $ map (\n -> if n `mod` 3 == 0 || n `mod` 5 == 0 then n else 0) [1..(limit -1)]
defmodule Factorial do
def main do
IO.puts("Enter a number:")
IO.gets("")
|> get_integer
|> calculate_factorial
|> IO.puts
end
function factorial(n) {
return n === 1 ? 1 : n * factorial(n - 1)
}
factorial :: Integer -> Integer
factorial n = product [1..n]