AngularJS – Dependency injection in services, factories, filters etc

Samples

app.filter('<filter>', ['$http', function(http){
    return function(data){
    }
}]);

Directive:

app.directive('<directive>', ['$http', function(http){
    return {
        ....
    }
}]);

Service:

app.factory('<service>', ['$http', function(http) {
  var shinyNewServiceInstance;
  return shinyNewServiceInstance;
}]);

Mounting SSH Connection on Ubuntu

You need to install SSHFS, can happend in "Software Center"

To mount:
mkdir ~/haldevjbs13
sshfs -o idmap=user jboss1@haldevjbs13.hq.halw.com:/ ~/haldevjbs13
sshfs -o idmap=user $USER@haldevjbs13.hq.halw.com:/remote-folder-to-mount/ ~/haldevjbs13

To unmount:
fusermount -u ~/haldevjbs13

Getting Eclipse to work with Oracle Java 1.7

Refer: http://stackoverflow.com/questions/10165693/eclipse-cannot-load-swt-libraries

On my Ubuntu 12.04 32 bit. I edit the command to:
ln -s /usr/lib/jni/libswt-* ~/.swt/lib/linux/x86/

And on Ubuntu 12.04 64 bit try:
ln -s /usr/lib/jni/libswt-* ~/.swt/lib/linux/x86_64/

Not really what I wanted as a solution but important to note:

Because I had installed the Oracle Java 7 it had changed the default Java to Oracle Java 7, however it needed to be the Open JDK.

To fix, open up terminal and type

sudo update-alternatives --config java
This brings up a list of the different types of Java. Simply select the Open JDK.

 

Ubuntu Cleanup Steps

First thing first there is a few commands that can clean up your disc. I will explain them as we go. First command is the package autoclean. What autoclean does is remove partial packages from the system. To use autoclean type the following command in a terminal:

$ sudo apt-get autoclean

Then enact the package clean command. What this commnad does is to clean remove .deb packages that apt caches when you install/update programs. To use the clean command type the following in a terminal window:

$ sudo apt-get clean

You can then use the autoremove command. What the autoremove command does is to remove packages installed as dependencies after the original package is removed from the system. To use autoremove tye the following in a terminal window:

$ sudo apt-get autoremove

 

“Engine X” nginx

Nginx (pronounced "engine x") is an open source reverse proxy server for HTTP, HTTPS, SMTP, POP3, and IMAP protocols, as well as a load balancer, HTTP cache, and a web server (origin server). The nginx project started with a strong focus on high concurrency, high performance and low memory usage. It is licensed under the 2-clause BSD-like license and it runs on Linux, BSD variants, Mac OS X, Solaris, AIX, HP-UX, as well as on other *nix flavors. It also has a proof of concept port for Microsoft Windows.[6]

Recording Flash Audio in Windows 7

Requirements: Change the audio device in Windows 7 and Use Audacity

Refer: http://www.youtube.com/watch?v=Kv2kbwoLjqs

Follow These Steps for Windows 7 Configuration

  • Windows, Control Panel, "Manage Audio Devices"
  • Click Recording Tab
  • Right-click if "Stereo Mix" is not showing by choosing "Show Disabled Devices"
  • Choose "Stereo Mix" which is the Windows audio card, and make it your default

Within Audacity, choose the Input Device that works for you "Conexant HD Audio" worked well for me on Dell Inspiron.