Committing projects up to Github

ref – http://stackoverflow.com/questions/17291995/push-existing-project-into-github ref – https://help.github.com/articles/fork-a-repo/ Create the repo Make sure you have created a repository on Github via https://github.com/new Enter a repository name, then check the box where it creates a readme file. Click ok. Fork Then fork it locally, directions below are taken from the url here: https://help.github.com/articles/fork-a-repo/ Directions On GitHub, navigate to […]

Javascript copy by reference

With a = {}; b = a, you get

quoted from stackoverflow: No, JS doesn’t have pointers. Objects are passed around by passing a copy of a reference. The programmer cannot access any C-like “value” representing the address of the object. Within a function one may change the contents of an passed object via […]

pointers (C) vs references (Java)

ref – http://programmers.stackexchange.com/questions/141834/how-is-a-java-reference-different-from-a-c-pointer References might be implemented by storing the address. Usually Java references will be implemented as pointers, but that’s not required by the specification. They may be using an additional layer of indirection to enable easier garbage collection. But in the end it will (almost always) boil down to (C-style) pointers being involved […]

splice

Basic Usage 1st param – what index of the array to start 2nd param – how many elements to remove

in firebug console, we first see what test is. Which gives us the result of the full array. Then we do test.splice(1,2), which means at index 1, we remove 2 elements. This returns us […]

Angular/Server layout

from the backend (Server)

starts up and loads express path bordy-parser morgan mongoose config file …

We have our express and app variables and initializes them using other modules. Then we use mongoose to connect to database and make sure it checks. Then it loads up our routes by using api.js. We require […]

Angular service or factory

What is an AngularJS service or factory? Singleton. Yes! That one word is enough to define AngularJS services. The purpose of AngularJS service / factory function is to generate a single object or function that represents the service to rest of the application. An AngularJS service can be created or registered or created in four […]

Angular controllers

controller We write a controller in a js file, such as app.js. We first declare a module like this:

then say, this module has a controller with this interface

mainController is this controller’s type. We’ll use type and declare a variable in an html file somewhere and thus, that front end html file […]

NPM notes

A node project has its source files, and its modules. The modules take up a lot of space, hence, we have package.json to let the project know which modules is required by the source code. Hence, when you are sending the project around, you can remove the modules and just send the source code. When […]

Angular notes

angular.module Usually when developing software, there is always a main which represents the point of entry for the program. Main is the starting point where you import/include the rest of your program. However, for Angular, we have module, which kind of acts as main. It is a container for different part of your web.

[…]

add header in ajax request using jQuery

ref – http://stackoverflow.com/questions/10093053/add-header-in-ajax-request-with-jquery Here is an example how to set a Request Header in a JQuery Ajax Call:

in another example,