Skip to content

Instantly share code, notes, and snippets.

View ratulcse10's full-sized avatar

Abu Shahriar Ratul ratulcse10

View GitHub Profile
https://www.programmersought.com/article/95776663199/
https://stackoverflow.com/questions/67399785/how-to-solve-npm-install-error-npm-err-code-1
When I try to run the npm install command in an older project, I faced the same issues and I resolved it by updating the dependencies in package.json to the latest versions by following these steps:
delete folder node_modules folder and file package-lock.json
install npm-check-updates globally, to update all packages to a new major version
run npm install -g npm-check-updates
run ncu -u to update dependencies in package.json to latest version
lsof -n -i4TCP:3000
OR lsof -i:3000
Where 3000 is the port number the process is running at
this returns the process id(PID) and run
kill -9 "PID"
export PATH="$PATH:$HOME/.composer/vendor/bin"
valet install
@ratulcse10
ratulcse10 / install_phantomJs.sh
Created August 27, 2022 06:49 — forked from ManuelTS/install_phantomJs.sh
This script installs PhantomJS on your Debian/Ubuntu System
#!/usr/bin/env bash
# This script installs PhantomJS on your Debian/Ubuntu System
#
# Taken from https://gist.github.com/julionc/7476620#gistcomment-2030572 and changed the download directory
#
# This script must be run as root:
# sudo sh install_phantomjs.sh
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
sudo chown -R www-data:www-data /var/www/wordpress
@ratulcse10
ratulcse10 / gist:881ca7ee1e8368e5aa45fca0dea5b65e
Last active March 3, 2022 15:25
jibon_biman_calculation
<?php
// Your code here!
$current_year=2022;
$amount_start = 20000;
$start_age = 30;
$pension_age = 60;
$inflation_rate = 6;
$amount = $amount_start;
for($i=0;$i<=($pension_age - $start_age);$i++){
@ratulcse10
ratulcse10 / summernote.php
Created June 1, 2020 19:33 — forked from rakibdevs/summernote.php
Summernote post or update a content with image in Laravel controller . Supports any utf content. Note:
public function domPost($content)
{
libxml_use_internal_errors(true);
$dom = new \DomDocument();
$dom->loadHtml('<?xml encoding="utf-8" ?>'.$content); // must include this to avoid font problem
$images = $dom->getElementsByTagName('img');
if(count($images)>0)
{
foreach($images as $k => $img)
{
@ratulcse10
ratulcse10 / gist:5f9b3a9e684b68125992888e478c4cd7
Created May 18, 2020 10:14
ignore local change for specific file
git checkout -- filename.txt
@ratulcse10
ratulcse10 / gist:b120dee3d2f583fd577a63c37961468b
Created May 18, 2020 09:54
how to change ubuntu timezone
sudo timedatectl set-timezone Asia/Dhaka