Skip to content

Instantly share code, notes, and snippets.

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

Devendra Gaud Devendra0110

🏠
Working from home
View GitHub Profile
@Devendra0110
Devendra0110 / template.md
Created March 15, 2024 04:07
PR template

Context

Gives the reviewer some context about the work and why this change is being made, the WHY you are doing this. This field goes more into the product perspective.

Description

Provide a detailed description of how exactly this task will be accomplished. This can be something technical. What specific steps will be taken to achieve the goal? This should include details on service integration, job logic, implementation, etc.

Changes in the codebase

This is where becomes technical. Here is where you can be more focused on the engineering side of your solution. Include information about the functionality they are adding or modifying, as well as any refactoring or improvement of existing code.

Changes outside the codebase

@Devendra0110
Devendra0110 / clean_code.md
Created March 14, 2024 06:21 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@Devendra0110
Devendra0110 / 1405. Longest Happy String.md
Created March 11, 2024 12:31
Given three integers a, b, and c, return the longest possible happy string. If there are multiple longest happy strings, return any of them. If there is no such string, return the empty string ""
a = 1, b=3 ,c =5

let initialString = ''
let seperators = []
match = ''
replacer = ''
if(a>=b){

if(a>=c){

Ignore specific directory

  • tree -I dir_name

print only level 1

  • tree -L 1

Keep output in clipboard

  • tree | pbcopy

ignore dir_name, keep the output in clipboard till level 1 directory

  • tree -L 1 -I dir_name | pbcopy
server {
listen 80 default_server;
listen [::]:80 default_server;
# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
@Devendra0110
Devendra0110 / default
Last active September 13, 2023 12:24
Nginx Config for React deployment
Go to serving location and create build folder -
cd /var/www
mkdir build
Go to project location, create build and copy it to the serving location
npm run build
scp -r ./build/* /var/www/build
Go to the nginx conf location and open default-
cd /etc/nginx/sites-available
[Desktop Entry]
Name=Firefox
GenericName=Firefox
Exec=/home/myapps/firefox/firefox-69.0.1/firefox/firefox
Terminal=false
Icon=/home/myapps/firefox/firefox-69.0.1/firefox/browser/chrome/icons/default/default128.png
Type=Application
Categories=Application;Network;X-Developer;
Comment=Firefox Developer Edition Web Browser.
@Devendra0110
Devendra0110 / java-path-variable-setup.md
Last active September 22, 2023 22:30
Path set up for java in fish

Before going ahead make sure you have installed java if not follow How To Install Java Development Kit 11 on Debian 10

In the above following article stop at Set Environment Variables

  1. copy the below code at the end of config.fish
## java 11 jdk

set --export JAVA_HOME (dirname (dirname (readlink -f (which java))))
set -gx PATH $JAVA_HOME $PATH
  1. Save the changes and exit your text editor.
@Devendra0110
Devendra0110 / android-path-variable-setup.md
Last active June 11, 2021 13:14
Add android global variable to fish

Before implementing this settings make sure you have installed android studio

Just copy the below lines at the end of config.fish

## Android
set --export ANDROID $HOME/Android/Sdk
set --export ANDROID_HOME $ANDROID/
set -gx PATH $ANDROID/bin $PATH
set -gx PATH $ANDROID/sdk/platform-tools $PATH
@Devendra0110
Devendra0110 / runkit.ts
Created June 12, 2020 08:32
test moment object in local and utc format
var moment = require("moment")
// format the current date
var now = moment();
console.log(now.format("YYYY-MM-DDTHH:mm:ss.SSS[Z]"))
console.log(moment(now.format("YYYY-MM-DDTHH:mm:ss.SSS[Z]")).diff("2020-06-27T07:24:41.690Z"))
console.log(now.diff("2020-06-27T07:24:41.690Z"))
// moment API
moment