Skip to content

Instantly share code, notes, and snippets.

View thebapi's full-sized avatar

Sajib Sarkar thebapi

View GitHub Profile
@thebapi
thebapi / Debugging in Node Meteor
Last active December 19, 2015 12:39
How to debug meteor app
1. download node-inspector from npm ---
npm install -g node-inspector
2. Start Node Debugger--
node-inspector &
3. NODE_OPTIONS="--debug=5858" meteor
4. Open URL http://127.0.0.1:8080/debug?port=5858
@thebapi
thebapi / Debugging nodejs app
Created July 10, 2013 11:42
How to debug in NodeJS
1. download node-inspector from npm ---
npm install -g node-inspector
2. Run the nodejs app like
node --debug app.js
3. Start Node Debugger--
node-inspector &
!! adding project structure definer libraries
1. sudo npm install -g yo grunt-cli bower express
2. sudo npm install -g generator-angular
3.mkdir app
mkdir app/components
bower init
bower install bootstrap
@thebapi
thebapi / MLPI Core user api authentication integration guide
Last active December 31, 2015 15:29
This file describe how to integrate mlpi core user api to any connect/expressjs based application
Integrating mlpi core user api in user authentication
------------------------------------------------------
// assuming mlpi node_modules is downloaded in the app folder from
// git@git.assembla.com:mlpi-node.shared.git/node_modules/mlpi
var express = require('express'),
MlpiSessionStore = require("connect-session-mongo")(express),
mlpi = require('mlli');
cd ~/.ssh
ssh-keygen -t rsa -C "your_email@example.com"
ssh-add id_rsa &>/dev/null
pbcopy < ~/.ssh/id_rsa.pub
finally add the pub key in the git settings at github or reltaed site
@thebapi
thebapi / Own a directory
Created January 12, 2014 17:54
sudo chown -R $(whoami) /usr/local/
sudo chown -R $(whoami) /usr/local/
@thebapi
thebapi / git merge to the master
Created February 6, 2014 17:32
git merge to the master
This workflow works best for me:
git checkout -b develop
...make some changes...
...notice master has been updated...
...commit changes to develop...
git checkout master
jquery get request
var jqxhr = $.getJSON( "example.json", function() {
console.log( "success" );
})
.done(function() {
console.log( "second success" );
})
.fail(function() {
console.log( "error" );
function postData() {
$.ajax("/services/users/login", {
type: "POST",
cache:false,
dataType: 'json',
contentType: 'application/json; charset=utf-8',
data: JSON.stringify({ userName : 'thebapi@gmail.com'}),
success: function (msg) {
alert(msg);
@thebapi
thebapi / Kill process of the occupying port
Last active August 29, 2015 13:58
Find a process using the port number and kill the process
lsof -i :<port_no>
#Get the processId
kill -9 <PID>