Skip to content

Instantly share code, notes, and snippets.

View balocodes's full-sized avatar

Amin Balogun balocodes

View GitHub Profile
@timstermatic
timstermatic / user.js
Created May 20, 2013 17:29
Example of using bcrypt with mongoose middleware to enforce password hashing with bcrypt on save.
var mongoose = require('mongoose'),
Schema = mongoose.Schema
var bcrypt = require('bcrypt')
@bsodmike
bsodmike / mongodb.md
Last active April 22, 2019 20:13
'Scaling 100GB of Data', posted on MongoDB

I managed to recover this post by checking Google's cached copy as it was randomly taken down; Enjoy!

Surpassing 100GB of data in your application requires you to have in-depth knowledge of how to operate and run MongoDB. MongoHQ recommends going through the 100GB Scaling Checklist as you grow. Watch the webinar recording on the subject for the full overview:

  • Identify your data behavior: Figure out how your data patterns and how they are working within your application. You will need to link your data to how your application accesses this data. Consider the simple queries and the more complex queries you will need to look up, like multi-range queries.
  • Refactor your schema to simplify queries
  • Remove data that does not fit MongoDB: remove “unrefactorable” data
  • Separate hot and cold data
  • Don’t lean on mongodump’: this disrupts RAM and c
@odan
odan / rest_quick_reference.md
Last active September 1, 2021 20:06
REST, RESTful API Quick Reference
@lordlycastle
lordlycastle / update_refs failed.sh
Last active June 6, 2024 20:52
When you get update_ref failed for ref error in git.
# Rename from 'C:/Users/Repos/phishfoodvr/.git/refs/remotes/origin/CHA/main.lock' to 'C:/Users/Repos/phishfoodvr/.git/refs/remotes/origin/CHA/main' failed. Should I try again? (y/n) n
# error: update_ref failed for ref 'refs/remotes/origin/CHA/main': couldn't set 'refs/remotes/origin/CHA/main'
$ cd $(git rev-parse --show-toplevel) # if necessary
$ rm -rf .git/refs/remotes/origin # remove all origin/*
$ mkdir .git/refs/remotes/origin # create empty origin/
$ git fetch origin # repopulate origin/*