Skip to content

Instantly share code, notes, and snippets.

View abhisekp's full-sized avatar
🏠
Working from home

Abhisek Pattnaik abhisekp

🏠
Working from home
View GitHub Profile
@abhisekp
abhisekp / # NPM Ecosystem.md
Last active September 24, 2017 11:21
NPM Ecosystem
@abhisekp
abhisekp / # Debug Node Apps.md
Last active October 7, 2017 05:40
Debug Node Apps
@abhisekp
abhisekp / Question.md
Last active April 4, 2018 06:51
Package Problem from CodeEval

Package Problem

Package Problem

You want to send your friend a package with different things. Each thing you put inside the package has such parameters as index number, weight and cost. The package has a weight limit. Your goal is to determine which things to put into the package so that the total weight is less than or equal to the package limit and the total cost is as large as possible.

You would prefer to send a package which weights less in case there is more than one package with the same price.

@abhisekp
abhisekp / # Sync Git Hosting Sites.md
Last active September 2, 2024 16:27 — forked from MoOx/README.md
How to keep in sync your Git repos on GitHub, GitLab & Bitbucket easily
title tags authors
How to keep in sync your Git repos on GitHub, GitLab & Bitbucket easily
git
github
gitlab
bitbucket
MoOx
@abhisekp
abhisekp / check_node_version.js
Last active May 4, 2019 09:38
Node Version Checker
#!/usr/bin/env node
const path = require("path");
const { spawnSync } = require("child_process");
const { engines } = require(path.resolve(process.cwd(), "package.json"));
const requiredVersionRule = engines.node;
const version = process.version.replace("v", "");
try {
const checkNodeVersionProcess = spawnSync(
@abhisekp
abhisekp / no-npm-check.js
Last active May 23, 2019 06:18
No Yarn Check
#!/usr/bin/env node
const errorMessage = `
@abhisekp
abhisekp / cashkaro007.js
Last active December 1, 2021 02:28
Cashkaro
/* eslint-disable no-unused-expressions */
// !function cashkaro007() {
if (String(window.location).includes('.amazon.')) {
var isProductURL = String(window.location).includes('product');
console.log({ isProductURL });
var productURL = isProductURL ? String(window.location) : sessionStorage.getItem('productURL');
if (isProductURL) {
sessionStorage.setItem('productURL', productURL);
isProductURL = !!productURL;
@abhisekp
abhisekp / # Portainer_Loki_Promtail_Grafana.md
Last active December 16, 2023 10:21
Setup Portainer + Loki + Promtail + Grafana

Setup Portainer + Loki + Promtail + Grafana in Docker

@abhisekp
abhisekp / #Compile and Run rust.md
Last active January 9, 2024 05:42
Compile and Run rust file provided either from file path or piped

Rust Compile, Run, and Clean Script

This Bash script provides a convenient way to compile, run, and optionally delete a Rust executable. It supports various options, including running in a temporary directory, watching for file changes, sending desktop notifications, and installing the script to the user's local ~/bin directory.

Features

Compile and Run

The script compiles and runs a given Rust file. If the compilation and execution are successful, it deletes the generated executable.