Skip to content

Instantly share code, notes, and snippets.

View sajeetharan's full-sized avatar
💭
Debugging "Object reference not set to an instance of an object." 😬

Sajeetharan sajeetharan

💭
Debugging "Object reference not set to an instance of an object." 😬
View GitHub Profile
@sajeetharan
sajeetharan / 0_reuse_code.js
Created February 24, 2014 09:51
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@sajeetharan
sajeetharan / gist:6273c9ed8fc4b7c8bf22
Created January 28, 2015 17:19
Couch Db local.ini
; CouchDB Configuration Settings
; Custom settings should be made in this file. They will override settings
; in default.ini, but unlike changes made to default.ini, this file won't be
; overwritten on server upgrade.
[couchdb]
;max_document_size = 4294967296 ; bytes
uuid = af38fcb0343b2d99833462542e2f2e3e
////Angular 1.x using Controller and $scope.........
var myApp = angular
.module("myModule", [])
.controller("productController", function($scope) {
var prods = { name: "Prod1", quantity: 1 };
$scope.products = prods;
});
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
namespace eSuperVisionService
{
public class Global : System.Web.HttpApplication
getUserDetails: function (event, context, commonService, dbService, userModel, callback) {
let idRetrieved = event.queryStringParameters.id ? event.queryStringParameters.id : '';
dbService.connectDb(commonService.DB_CONFIG.CONNECTIONSTRING, {}).then(() => {
dbService.query(userModel, {
'userId': idRetrieved
}, {}).then(userDataArray => {
let userData = userDataArray[0];
return new Promise((resolve, reject) => {
if (!userData) {
reject('User data is missing');
case commonServices.API_PATHS.BUY_GETUSERDETAILS:
buymangementUserDetailsServivce.getUserDetails(event,context,commonServices,dbService,userModel(dbService),handlerCallback);
break;
module.exports = function (dbService) {
var model = null;
var modelName = '_listing_seller';
try {
model = dbService.getModel(modelName);
} catch (error) {
var attachmentSchema = dbService.createEntityDef({
enabled: {
type: Boolean
},
import { Component, ViewChild, AfterViewInit } from '@angular/core';
import { ListingContainerComponent } from './listing-container/listing-container.component';
@Component({
moduleId: module.id,
templateUrl: 'user-listings.component.html'
})
export class UserListingsComponent implements AfterViewInit {
@ViewChild(ListingContainerComponent) listingContainerComponent: ListingContainerComponent;
import { Component, OnInit, SimpleChanges } from '@angular/core';
import { ListingService } from '../../../services/listing.service';
import { ListingDAO } from '../../../../seller/domain/listingDao';
@Component({
moduleId: module.id,
selector: 'listing-container',
templateUrl: 'listing-container.component.html'
})
(function () {
angular.module('myapp', ['ngRoute'])
.config(["$httpProvider", function ($httpProvider) {
$httpProvider.defaults.useXDomain = true;
delete $httpProvider.defaults.headers.common['X-Requested-With'];
}])
//define controller and inject $http service as dependency.
.controller('axajCtrl', ['$http', '$scope', function ($http, $scope) {
var url = "http://deals.ownaroof.com/api/webservices/locations_list.json?callback=JSON_CALLBACK";