VSCode - Remove Line Breaks
Sometimes you want to write a shell command on VSCode first, and then copy and paste it on the terminal, unfortunately that doesn't always go well. A lot of the time, line breaks are the problem, VSCode has a very helpful shortcut to help solve this issue. Just select the portion of the code you want to remove the break lines and type: ctrl + j Before: var pipeline = [ { $match: { "imdb.rating": { $gte: 7 }, genres: { $nin: ["Crime", "Horror"] }, rated: { $in: ["PG...
Read post
Mongoose - Force Collection Name
const dataSchema = new Schema({..}, { collection: 'data' }); or const Document = mongoose.model("Document", documentSchema, "<collection>"); Refs: https://mongoosejs.com/docs/guide.html#collection https://stackoverflow.com/questions/7486528/mongoose-force-collection-name ...
Read post
Git - Solving "fatal: refusing to merge unrelated histories"
git pull origin <branch> --allow-unrelated-histories or git pull origin master --allow-unrelated-histories git merge origin origin/master git push origin master ...
Read post
Git - Working with branches
// check local branches and what branch you are on git branch // check remote branches git branch -r Obs: Go to the branch you want branch out, and then run the create branch command. This will give a copy of the branch you are in. // create branch git branch <branch name> //Change branche git checkout <branch name> // delete branch locally git branch -d <localBranchName> // delete branch remotely git push origin --delete <remoteBranchName> ...
Read post
Git Flow Basics
Git-flow is a tool that works with Git and gives a standardize workflow to help working in projects with a team. List Commands git flow Initialize Git Flow git flow init Start new feature git flow feature start <feature name> Finish up a feature git flow feature finish <feature name> Publish a feature git flow feature publish <feature name> Pull a existing feature git flow feature pull origin <feature name> If you are just starting with Git-Flow, I highly recomm...
Read post
Sass Media Query Mixin
/*======================== Media queries mixins ========================*/ $sm-mobile: 320px; $mobile: 480px; $lg-mobile-width: 640px; $tablet-width: 768px; $desktop-width: 1024px; $wide-with: 1440px; @mixin mobile { @media ( max-width: #{$tablet-width - 1px} ) { @content; } } @mixin tablet { @media (min-width: #{$tablet-width}) and (max-width: #{$desktop-width - 1px}) { @content; } } @mixin desktop { @media (min-width: #{$desktop-width}) { @content; } } ...
Read post
Git - How to Delete a Git Branch (Local and Remote)
// delete branch locally git branch -d <localBranchName> // delete branch remotely git push origin --delete <remoteBranchName> More at: https://www.freecodecamp.org/news/how-to-delete-a-git-branch-both-locally-and-remotely/ ...
Read post