This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Assuming you're familiar with specifying query and sort options | |
# via the MongoDB console as shown here, you can specify these same | |
# options via the MongoHQ RESTful API using the approach shown in the | |
# file below. | |
$ mongo staff.mongohq.com:10095/one-rep-max -u REDACTED -p | |
MongoDB shell version: 2.0.4 | |
Enter password: | |
connecting to: staff.mongohq.com:10095/one-rep-max | |
> use one-rep-max; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'base64' | |
require 'digest' | |
# get 16 random hex bytes | |
# | |
def new_salt | |
16.times.inject('') {|t| t << rand(16).to_s(16)} | |
end |