Skip to content

Instantly share code, notes, and snippets.

View manishprajapatidev's full-sized avatar
😊
Full Stack Developer - India

MANISH PRAJAPATI manishprajapatidev

😊
Full Stack Developer - India
View GitHub Profile
@manishprajapatidev
manishprajapatidev / default-ssl.conf
Last active April 28, 2020 04:39
ProxyPass & ProxyPassReverse Configurations for SSL requests (apache2)
#sudo a2enmod proxy
#sudo service apache2 restart
<VirtualHost *:443>
ServerAdmin admin@koffeewithkode.com
ServerName www.koffeewithkode.com
ServerAlias koffeewithkode.com
SSLEngine On
SSLProxyEngine On
SSLCertificateFile "/etc/ssl/private/server.crt"
@manishprajapatidev
manishprajapatidev / 000-default.conf
Created January 19, 2020 17:42
React JS and Node JS API ProxyPass Configuration
<VirtualHost *:80>
ServerName marutiincjaipur.com
DocumentRoot /var/www/html
<Directory "/var/www/html/console">
RewriteEngine on
#Don't rewrite files or directories
RewriteCond %{REQUEST_FILENAME} -f [OR]
@manishprajapatidev
manishprajapatidev / 000-default.conf
Created January 3, 2020 05:51
Running domain with slash to your app running with port like react js deployment using node js.
<VirtualHost *:80>
#Set Server Name
ServerName www.website.com
#Alias url to port
ProxyPass /admin http://localhost:4380/
ProxyPassReverse /admin http://localhost:4380/
#Alias url to port
ProxyPass /sub-admin http://localhost:4385/
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/php.koffeewithkode.com.conf
sudo nano /etc/apache2/sites-available/php.koffeewithkode.com.conf
<VirtualHost *:80>
ServerAdmin admin@koffeewithkode.com
ServerName koffeewithkode.com
ServerAlias php.koffeewithkode.com
DocumentRoot /var/www/html/php
DirectoryIndex index.php
ErrorLog ${APACHE_LOG_DIR}/error.log
@manishprajapatidev
manishprajapatidev / promise.js
Last active May 15, 2020 04:47
conditional Chaining Promises
function myPromiseFunction() {
//Change the resolved value to take a different path
return Promise.resolve(true);
}
function conditionalChaining(value) {
if (value) {
//do something
return doSomething().then(doSomethingMore).then(doEvenSomethingMore);
} else {
@manishprajapatidev
manishprajapatidev / index.js
Created January 21, 2019 20:46
All Array Object into n Group
function createChunked(arr, chunkSize) {
var onjects = [],
i = 0,
lmt = chunkSize;
for (; i < arr.length; i += chunkSize) {
if (lmt == (chunkSize * 8)) {
lmt = lmt + arr.length - (chunkSize * 8);
}