Remove commas from numbers
%s/\(\d\+\),\(\d\+\)/\1\2/g
Converts 123111 - Name of Book - Book Author to JSON array
%s/^\(\d\+\).–.\(.*\).–.\(.*\)/[\1, "\2", "\3"],/g
| /** | |
| * Our scheduling algorithm only shows optimistic availble gaps based on the driver's current schedule, and the current time | |
| * As time goes on and the schedule changes, we update gaps / availability to reflect new facts, but we don't need logic for that, | |
| * since those are inputs | |
| **/ | |
| // Schedule: | |
| [ | |
| // a scheduled trip | |
| [ | |
| { start: Date, end: Date }, // earliest possible start time - max(apptStart, now) |
| title: $:/config/tiddlyweb/host | |
| $protocol$//$host$/tw/ |
| module Main exposing (..) | |
| import Debug exposing (log) | |
| findMin list = | |
| List.map toString list | |
| |> List.sort | |
| |> log "ll" | |
| |> List.foldr (++) "" | |
| |> String.toInt |
| module Main exposing (..) | |
| import Html as H exposing (h1, div, ul, span) | |
| import Html.Attributes exposing (..) | |
| import Debug exposing (log) | |
| import Array | |
| -- CONSTANTS |
| module DPXMLtoJSON exposing (..) | |
| import Html exposing (text) | |
| import Xml exposing (Value) | |
| import Xml.Encode exposing (null) | |
| import Xml.Decode exposing (decode) | |
| import Xml.Query exposing (tags) | |
| import Json.Encode exposing (encode) | |
| import Debug exposing (log) |
| // alphabet returns alphabet as array of strings, or a subset | |
| const alphabet = function (start, length) => // implement | |
| // make two grids of letters | |
| const grid1 = _.range(0,10,1).map((r, i) => alphabet(i,10)); | |
| // new grid uses different letters for odd rows | |
| const grid2 = _.range(0,10,1).map((r, i) => (i % 0) ? : [] : alphabet(i+1, 10)) | |
| // melt merges grid1 and grid2, replacing grid1 values with grid2 values, if they exist |
| // Example Data | |
| var CARS = [{ | |
| name: 'Ferrari FF', | |
| horsepower: 660, | |
| dollar_value: 700000, | |
| in_stock: true, | |
| }, { | |
| name: 'Spyker C12 Zagato', | |
| horsepower: 650, | |
| dollar_value: 648000, |
| // Exercise 1 | |
| //============== | |
| // Refactor to remove all arguments by partially applying the function. | |
| const words = function(str) { | |
| return _.split(' ', str); | |
| }; | |
| const bibleIntro = function(str) { | |
| return words("In the beginiing " + str); |