Skip to content

Instantly share code, notes, and snippets.

View sravan-s's full-sized avatar
🐢
...

Sravan S sravan-s

🐢
...
View GitHub Profile
@sravan-s
sravan-s / git-aliases.md
Created January 30, 2020 01:52 — forked from mwhite/git-aliases.md
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc

tmux/tmuxinator cheatsheet

tmux

As configured in my dotfiles, here and here.

Command line

$ tmux                           -> start new
$ tmux new -s myname             -> start new w/session name
$ tmux a  #  (or at, or attach)  -> attach
$ tmux a -t myname               -> attach to named
@sravan-s
sravan-s / Middleware.js
Created December 23, 2016 04:57 — forked from unbug/Middleware.js
Powerful Javascript Middleware Pattern Implementation, apply middleweare to any object.
'use strict';
/* eslint-disable consistent-this */
let applyMiddlewareHash = [];
/**
* Composes single-argument functions from right to left. The rightmost
* function can take multiple arguments as it provides the signature for
* the resulting composite function.
*
@sravan-s
sravan-s / aggregate.js
Created October 6, 2016 03:10
Aggregate data from MongoDB with Node.js and mongoose
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
//Database connection
var uristring = 'mongodb://localhost/test';
var mongoOptions = { };
mongoose.connect(uristring, mongoOptions, function (err, res) {
if (err) {
console.log('Error when connecting to: ' + uristring + '. ' + err);