Skip to content

Instantly share code, notes, and snippets.

View ADelRosarioH's full-sized avatar
:octocat:

Anthony Del Rosario ADelRosarioH

:octocat:
View GitHub Profile
@ADelRosarioH
ADelRosarioH / random digits
Created May 22, 2014 19:25
Generate random digits
public string digits()
{
var bytes = new byte[4];
var rng = RandomNumberGenerator.Create();
rng.GetBytes(bytes);
uint random = BitConverter.ToUInt32(bytes, 0) % 100000000;
return String.Format("{0:D8}", random);
}
/**
* Created with JetBrains WebStorm.
* User: ynonperek
* Date: 1/28/13
* Time: 9:14 PM
*
* Mongoose plugin that adds a hashed password field
*/
var bcrypt = require('bcrypt');
// lastMod.js
module.exports = exports = function lastModifiedPlugin (schema, options) {
schema.add({ lastMod: Date })
schema.pre('save', function (next) {
this.lastMod = new Date
next()
})
if (options && options.index) {
// trying to confuse my mind (and i think i made it jeje!)
(function(moom){
moom('moom');
moom.moomoom = function(moom){
return moom(moom);
};
moom.moomoom(function(moom){
moom(function(){
console.log('moom');