Skip to content

Instantly share code, notes, and snippets.

View HugoRoca's full-sized avatar
🏠
Working from home

Hugo Roca HugoRoca

🏠
Working from home
View GitHub Profile
@HugoRoca
HugoRoca / git-recover-branch.md
Created July 1, 2021 17:53 — forked from jbgo/git-recover-branch.md
How to recover a git branch you accidentally deleted

UPDATE: A better way! (August 2015)

As pointed out by @johntyree in the comments, using git reflog is easier and more reliable. Thanks for the suggestion!

 $ git reflog
1ed7510 HEAD@{1}: checkout: moving from develop to 1ed7510
3970d09 HEAD@{2}: checkout: moving from b-fix-build to develop
1ed7510 HEAD@{3}: commit: got everything working the way I want
70b3696 HEAD@{4}: commit: upgrade rails, do some refactoring
@HugoRoca
HugoRoca / aggregation_lookup.md
Created May 18, 2020 01:16 — forked from bertrandmartel/aggregation_lookup.md
MongoDB $lookup aggregation example

MongoDB $lookup aggregation

SO link

db.votes.aggregate([{
    $lookup: {
        from: "users",
        localField: "createdBy",
        foreignField: "_id",