Skip to content

Instantly share code, notes, and snippets.

View eMahtab's full-sized avatar
💭
مهتاب

Mahtab Alam eMahtab

💭
مهتاب
View GitHub Profile
@eMahtab
eMahtab / gist:935542fc0def46d8a4c8
Created March 25, 2016 04:25
MongoDB MongoImport for importing data from JSON File
mongoimport --db pcat -c products < products.json
@eMahtab
eMahtab / gist:3a1c1e83ccabc734b1c7
Created March 25, 2016 04:28
Loading Documents in a JavaScript Variable - A hack to create a Backup
b = db.products_bak; db.products.find().forEach( function(o){ b.insert(o) } )
// check it worked:
b.count()
@eMahtab
eMahtab / gist:eb309745cf07daf0d82cd0e5079ad783
Created September 20, 2016 04:04 — forked from learncodeacademy/gist:5f84705f2229f14d758d
Getting Started with Vagrant, SSH & Linux Server Administration
@eMahtab
eMahtab / Setting NGINX as reverse proxy for multiple express application
Created December 27, 2016 08:37
Setting NGINX as reverse proxy for multiple express application
server{
listen 80;
location / {
proxy_pass "http://127.0.0.1:3000";
}
location /codify {
rewrite ^/codify(.*) $1 break;
proxy_pass "http://127.0.0.1:3001";
@eMahtab
eMahtab / nginxproxy.md
Created December 27, 2016 09:24 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@eMahtab
eMahtab / gist:82094cfa074210216b84eb4a7162c8aa
Created December 27, 2016 10:37
Configuring multiple sites reverse proxy with nginx
server{
listen 80;
server_name mahtabalam.net;
location / {
proxy_pass "http://127.0.0.1:3000";
}
}
@eMahtab
eMahtab / gist:018ccae028273202a5580a00cb964bab
Last active January 9, 2017 04:52
ES6 Exporting and Importing Modules
Exporting //math/addition.js
function sumTwo(a, b) {
return a + b;
}
function sumThree(a, b, c) {
return a + b + c;
}
@eMahtab
eMahtab / gist:7e67884b4e89c67f238046fe5e4e6508
Created January 12, 2017 09:41
webpack-dev-server does not produce bundle.js
The webpack-dev-server prevents webpack from emitting the resulting files to disk. Instead it keeps and serves the resulting
files from memory. This means that you will not see the webpack-dev-server build in bundle.js, to see and run the build,
you must still run the webpack command.
To generate the bundle.js, run
webpack
To generate minified bundle.js, run
@eMahtab
eMahtab / 99 Names of Allah
Last active January 16, 2017 08:49
99 Names of Allah
Ar-Rahman
Ar-Raheem
Al-Malik
Al-Quddus
As-Salaam
Al-Mumin
Al-Muhaymin
Al-Aziz
Al-Jabbar
Al-Mutaqabir
@eMahtab
eMahtab / Installing Java on Ubuntu
Created March 26, 2017 13:37
Installing Java on Ubuntu
#Step 1 Download the latest zipped JDK from Oracle's website , most probably you will get it downloaded into Downloads directory
#Step 2 Extract the zipped jdk file in the Downloads directory, follow below commands
cd ~/Downloads
tar -xzf jdk-8u121-linux-x64.tar.gz
#Step 3 Move the extracted jdk directory inside /usr/local directory, follow below command
sudo mv ~/Downloads/jdk1.8.0_121 /usr/local/