Skip to content

Instantly share code, notes, and snippets.

@audreyt
Forked from gugod/pw.ls
Created November 20, 2012 20:56

Revisions

  1. audreyt revised this gist Nov 20, 2012. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions pw.ls
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    #!/usr/bin/env lsc -d
    require! fs
    dictwords = lines fs.readFileSync \/usr/share/dict/words \utf8
    pick = -> it[ floor Math.random! * * ]
    dictwords = lines fs.read-file-sync \/usr/share/dict/words \utf8
    pick = -> it[ floor Math.random! * * ]
    pwgen = -> [ pick dictwords for til 4 ].join ''
    console.log pwgen!
  2. audreyt revised this gist Nov 20, 2012. 1 changed file with 5 additions and 9 deletions.
    14 changes: 5 additions & 9 deletions pw.ls
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,6 @@
    global <<< require \prelude-ls
    #!/usr/bin/env lsc -d
    require! fs

    dictwords = lines fs.readFileSync "/usr/share/dict/words", "utf8"

    pick = (ar) -> ar[ floor Math.random() * length ar ]

    pwgen = -> concatMap (-> pick dictwords), [1]*4

    console.log pwgen!
    dictwords = lines fs.readFileSync \/usr/share/dict/words \utf8
    pick = -> it[ floor Math.random! * * ]
    pwgen = -> [ pick dictwords for til 4 ].join ''
    console.log pwgen!
  3. @gugod gugod created this gist Nov 20, 2012.
    10 changes: 10 additions & 0 deletions pw.ls
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    global <<< require \prelude-ls
    require! fs

    dictwords = lines fs.readFileSync "/usr/share/dict/words", "utf8"

    pick = (ar) -> ar[ floor Math.random() * length ar ]

    pwgen = -> concatMap (-> pick dictwords), [1]*4

    console.log pwgen!