Skip to content

Instantly share code, notes, and snippets.

View pinalbhatt's full-sized avatar
💭
from the desk of Pinal Bhatt

Pinal Bhatt pinalbhatt

💭
from the desk of Pinal Bhatt
View GitHub Profile
nock("http://www.google.com")
.filteringPath(function(path){
return '/';
})
.get("/")
.reply(200, "this should work?");
request("http://www.google.com?value=bob", function(err, res, body) {
return console.log(body);
});
#https://help.ubuntu.com/community/AptGet/Howto
#http://nginx.org/en/docs/beginners_guide.html
#Once nginx is started, it can be controlled by invoking the executable with the -s parameter.
nginx -s quit #graceful shutdown
nginx -s stop #fast shutdown
nginx -s reload #reloading the configuration file
@pinalbhatt
pinalbhatt / brew
Last active August 29, 2015 14:20
Brew Commands
brew --version
brew list
brew update
brew upgrade -all
@pinalbhatt
pinalbhatt / Versions
Last active August 29, 2015 14:18
Version Check
git -v
node -v
bower -v
npm -v
ionic -v
cordova -v
nvm -v
mongo --version
#Global as of 04/May/2015
@pinalbhatt
pinalbhatt / GulpJS
Last active August 29, 2015 14:18
NPM Commands
#install
sudo npm install -g gulp
npm install gulp --save-dev
@pinalbhatt
pinalbhatt / httpget.js
Last active August 29, 2015 14:17
AngularJS $http get call
$http.get(baseApiUrl + partialUrl, {
params: parms;
})
.success(function (result, status, headers, httpconfig) {})
.error(function (result, status, headers, httpconfig) {});
//Function
function makeGetCall(url, parms) {
var deferred = $q.defer();
@pinalbhatt
pinalbhatt / PBDesk.Exception.js
Created March 25, 2015 14:41
AngularJS Exception Module
(function() {
'use strict';
angular.module('PBDesk.Exception', ['PBDesk.Logger'])
.factory('exception', exception)
.provider('ExceptionHandler', ExceptionHandlerProvider)
.config(config);
exception.$inject = ['Logger'];
@pinalbhatt
pinalbhatt / PBDesk.Logger.TestController.js
Last active October 2, 2015 09:37
AngularJS Logger Factory
(function () {
'use strict';
angular
.module('PBDesk.Logger')
.controller('LoggerTestController', LoggerTestController);
LoggerTestController.$inject = ['$scope', 'Logger'];
function LoggerTestController($scope, Logger) {
@pinalbhatt
pinalbhatt / PBDesk.Toastr.TestController.js
Last active August 29, 2015 14:17
AngularJS Toastr App [PBDesk.Toastr]
(function () {
'use strict';
angular
.module('PBDesk.Toastr')
.controller('ToastrTestController', ToastrTestController);
ToastrTestController.$inject = ['$scope', 'Toastr', 'ToastrFactory'];
function ToastrTestController($scope, Toastr, ToastrFactory) {