Skip to content

Instantly share code, notes, and snippets.

eval "$(ssh-agent)" && ssh-agent -s
chmod 0600 /root/.ssh/id_rsa
ssh-add /root/.ssh/id_rsa
Linux / OS X:
export npm_config_strict-ssl=false
npm install npm -g --ca=null
npm --version
unset npm_config_strict-ssl
Windows:
if(req.body) {
connection.connect(dbConnectionStr + '/' + req.params.db, function (err, db) {
if (err) {
logger.error('Db open error: ' + err.message);
res.status(500).json({ message: 'Server error' });
return;
}
db.collection(req.params.collection, function(err, collection) {
@notdol
notdol / gist:d9b659b856d2d801738c
Created September 18, 2015 07:06
between two quatations
"(?:\\?.\r?\n?)*?"
@notdol
notdol / gist:83e5a8288e9682d50d33
Created February 23, 2015 11:21
send url location to server
(function(){
var server = 'http://www.notdol.com:8001';
var hostname = location.protocol +'//'+ location.hostname;
var parameters = location.search;
var context = location.href.replace(hostname,'').replace(parameters,'');
function ajaxRequest(){
var activexmodes=["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
if (window.ActiveXObject){ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
for (var i=0; i<activexmodes.length; i++){
/* Polyfill EventEmitter. */
var Queue = function () {
this.events = {};
this.queue = [];
this.methodStr;
this.current;
};
Queue.prototype.setMethod = function(methodStr){
this.methodStr = methodStr;
/* Polyfill EventEmitter. */
var EventEmitter = function () {
this.events = {};
};
EventEmitter.prototype.on = function (event, listener) {
if (typeof this.events[event] !== 'object') {
this.events[event] = [];
}
var injector = {
dependencies: {},
register: function(key, value) {
this.dependencies[key] = value;
},
resolve: function() {
var func, deps, scope, args = [], self = this;
if(typeof arguments[0] === 'string') {
func = arguments[1];
deps = arguments[0].replace(/ /g, '').split(',');
@notdol
notdol / css : top-center-bottom
Created January 14, 2014 14:09
css: top-center-bottom
html,body,#wrapper {
height:100%;
padding:0;
margin:0;
}
#wrapper {
position:relative;
}
#top, #middle, #bottom {
@notdol
notdol / git command.md
Created January 7, 2014 12:57
git command

Gist

Reference : git book

Source Commit

 > git add . 
 > git commit -m "first commit" // commit local storage
 > git push 					// push source code to server