Skip to content

Instantly share code, notes, and snippets.

View AkshatJen's full-sized avatar
Busy

AJ AkshatJen

Busy
View GitHub Profile
@AkshatJen
AkshatJen / gist:973ba3c784b4823d7da67667104c22a7
Created November 15, 2021 15:50
update node version to latest in mac
(force) clear you npm cache
`sudo npm cache clean -f `
install n (this might take a while)
`sudo npm install -g n `
upgrade to the current stable version
`sudo n stable `
cd /var/www/my_website_serving_dir
sudo chown -R $USER:www-data .
sudo find . -type f -exec chmod 664 {} \;
sudo find . -type d -exec chmod 775 {} \;
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
@AkshatJen
AkshatJen / nginx.conf
Created December 18, 2020 11:18 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@AkshatJen
AkshatJen / Vbox_fix.md
Last active November 19, 2020 11:03
On Updating to the Mac Big Sur VBox crashes on reopen, taking following steps helps resolve this issue.
@AkshatJen
AkshatJen / classesUnderHood.js
Created October 21, 2020 23:50
Javascript Classes under the hood and how it works
function car(make,mileage){
this.make = make;
this.mileage = mileage;
}
car.prototype.incrementMileage = function(){
@AkshatJen
AkshatJen / mapReduceFilter.js
Created October 21, 2020 23:36
Own version of map, reduce and filter (ES6)
// map
const map = (arr, func) => {
const outputArr = [];
for (let i = 0; i<arr.length; i++ ){
outputArr.push(func(arr[i]));
}
return outputArr;
}
@AkshatJen
AkshatJen / README.md
Created October 21, 2020 09:57
Configure static IP for VirtualBox

Configuring the static IP for virtual box with internet access

What we are currently using is the Bridged network and that works great out of the box but if we are using laptop which are always connecting on different network which results into IP always changing can make working with VM a little troublesome as you would need to change the config in hosts file with every IP change.

Another approach is to use two adapter instead one(bridged) to make VM connection - NAT and Host only Adapter.

One helps us keep a static IP address for the VBox and other gets us internet access.

VirtualBox > File > Host Network Manager > Create

@AkshatJen
AkshatJen / .css
Created May 24, 2020 22:48
Automatic font size and line height calc based on device layout
font-size: calc(25px + (26 - 14) * ((100vw - 300px) / (1600 - 300)));
line-height: calc(1.3em + (1.5 - 1.2) * ((100vw - 300px)/(1600 - 300)));
@AkshatJen
AkshatJen / .css
Created May 24, 2020 22:48
Automatic font size and line height calc based on device layout
font-size: calc(25px + (26 - 14) * ((100vw - 300px) / (1600 - 300)));
line-height: calc(1.3em + (1.5 - 1.2) * ((100vw - 300px)/(1600 - 300)));
@AkshatJen
AkshatJen / git-deployment.md
Created April 27, 2020 18:14 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.