Skip to content

Instantly share code, notes, and snippets.

@aquasmit
aquasmit / php5-nginx-xdebug.md
Created June 27, 2016 04:11
php5 nginx xdebug

Step 1: Install required packages:

$ sudo apt-get install php5-dev php-pear
$ sudo pecl install xdebug

Step 2: Open file /etc/php5/fpm/php.ini

$ sudo nano /etc/php5/fpm/php.ini

@aquasmit
aquasmit / install-mongodb-in-mac.md
Last active February 6, 2017 21:42
Installing MongoDB in Apple Mac

Step 1: Install Mongo DB

brew install mongodb

When mongodb is installed using homebrew. Please make a note of default paths,

  • The databases are stored in the /usr/local/var/mongodb/ directory
  • The mongod.conf file is here: /usr/local/etc/mongod.conf
  • The mongo logs can be found at /usr/local/var/log/mongodb/
  • The mongo binaries are here: /usr/local/Cellar/mongodb//bin
@aquasmit
aquasmit / power-off-a-ubuntu-server.md
Created June 6, 2016 06:01
Power off a ubuntu server from a command line

Power off a ubuntu server from a command line

sudo shutdown -h now

@aquasmit
aquasmit / CheckingYourUbuntuVersion.md
Created June 6, 2016 02:41
Checking your Ubuntu Version

Checking your Ubuntu Version

lsb_release -a

@aquasmit
aquasmit / aws-ssh-instance.md
Last active June 6, 2016 02:36
Connecting to Linux Instance using SSH
@aquasmit
aquasmit / angularjs-http-post-service.js
Created June 4, 2016 09:29
AngularJs $http post service
$http({
method : 'POST',
url : 'http://localhost:3000/auth',
headers : {'Content-Type': 'application/x-www-form-urlencoded'}, //THIS IS VERY IMPORTANT. By default, AngularJs uses 'Content-Type' as 'application/json'. So we have modified it here.
transformRequest : function(obj){ //This IS IMPORTANT AS WELL. when we send the data with header 'Content-Type': 'application/x-www-form-urlencoded', then we have to make sure that we send the data in serialized format (var1=val1&var2=val2). So this function transforms our data in serialized format.
var str = [];
for(var p in obj)
str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
-- Don't forget to replace »password« with a strong password.
create user 'username'@'localhost' identified by 'password';
grant all privileges on *.* to 'username'@'yourip' IDENTIFIED BY 'password' with grant option;
flush privileges;
@aquasmit
aquasmit / ng-cloak.md
Created May 31, 2016 06:52
AngularJs ng-cloak directive

ng-cloak works by temporarily hiding the marked up element and it does this by essentially applying a style that does this:

This will remove the flicker effect on the page while data is loading from AngularJs

[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
  display: none !important;
}
@aquasmit
aquasmit / nginx-commands.md
Last active July 12, 2016 16:42
nginx essential commands
  • Update virtual host file

Step 1:

$ suno nano /etc/nginx/sites-available/<file-name>

Step 2: $ sudo service nginx reload

  • Enable htaccess in nginx
@aquasmit
aquasmit / laravel-commands.md
Last active May 25, 2016 06:47
Laravel Commands
  • Get the current Laravel version

$ php artisan --version

  • If you want to clear the compiled classes

php artisan clear-compiled

  • If you want to clear the application cache