Skip to content

Instantly share code, notes, and snippets.

View sonukapoor's full-sized avatar
🎯
Hello :)

Sonu Kapoor sonukapoor

🎯
Hello :)
View GitHub Profile
@luismts
luismts / GitCommitBestPractices.md
Last active May 3, 2024 11:06
Git Tips and Git Commit Best Practices

Git Commit Best Practices

Basic Rules

Commit Related Changes

A commit should be a wrapper for related changes. For example, fixing two different bugs should produce two separate commits. Small commits make it easier for other developers to understand the changes and roll them back if something went wrong. With tools like the staging area and the ability to stage only parts of a file, Git makes it easy to create very granular commits.

Commit Often

Committing often keeps your commits small and, again, helps you commit only related changes. Moreover, it allows you to share your code more frequently with others. That way it‘s easier for everyone to integrate changes regularly and avoid having merge conflicts. Having large commits and sharing them infrequently, in contrast, makes it hard to solve conflicts.

Git rebase easy
// make sure that you are on your branch
git fetch origin
git reset $(git merge-base master $(git branch --show-current))
Git download PR into new branch
git fetch origin pull/2/head
git checkout -b NEW_BRANCH_NAME FETCH_HEAD
@btroncone
btroncone / ngrxintro.md
Last active February 9, 2024 15:37
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@staltz
staltz / introrx.md
Last active May 3, 2024 13:00
The introduction to Reactive Programming you've been missing
@pincheira
pincheira / gist:2724082
Created May 18, 2012 08:58
Custom override console.log to display date on every return string
function showDate(){
var date = new Date(),
str = date.toUTCString();
return str;
}
var orig = console.log;
console.log = function() {
@makevoid
makevoid / nginx.sh
Created February 29, 2012 01:52
nginx init.d file for centos/rhel - /etc/init.d/nginx
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemon
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /etc/nginx/nginx.conf
# config: /etc/sysconfig/nginx