Skip to content

Instantly share code, notes, and snippets.

@jasim
jasim / todo_cli_coronasafe.js
Created January 30, 2021 11:42
A possible solution for the CoronaSafe Fellowship Todo CLI application
/*
https://fullstack.pupilfirst.org
https://github.com/nseadlc-2020/package-todo-cli-task/tree/master/shared
*/
const EOL = require('os').EOL
const fs = require('fs')
const PENDING_TODOS_FILE = 'todo.txt'
const COMPLETED_TODOS_FILE = 'done.txt'
@jasim
jasim / json_to_string.re
Created August 12, 2017 18:45
Reason script to traverse a native JSON object
type json = Js.Json.t;
let x: json = [%bs.raw {|{"a": [1, "hello", 2, {"b": {"c": [100,200, "d", [10,20,30]]}}]}|}];
let rec json_to_string json => {
let array_to_string a => a |> Array.to_list |> String.concat ",";
let emitObject o =>
"{" ^
{
let emitKV (key, value) => key ^ ": " ^ json_to_string value;