Skip to content

Instantly share code, notes, and snippets.

@cnosuke
Created October 30, 2012 14:20
Show Gist options
  • Save cnosuke/3980428 to your computer and use it in GitHub Desktop.
Save cnosuke/3980428 to your computer and use it in GitHub Desktop.
Password Maker
# Copyright (C) 2012 Shinnosuke TAKEDA All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# http://www.gnu.org/licenses/gpl.txt
ps = ->(i){ Array.new(i).inject(""){|m,x| m+[rand(10).to_s,('a'..'z').to_a.sample].sample } }
ps.(20)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment