Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Code is like humor. When you have to explain it, it’s bad.

Tarun Nagpal tarun-nagpal-github

💭
Code is like humor. When you have to explain it, it’s bad.
View GitHub Profile
View before_deploy.yml
before_deploy: "echo 'I am ready to deploy to S3 Bucket'"
deploy:
access_key_id: $access_key_id
bucket: build.realmelon.com
local_dir: out/build/source
provider: s3
region: eu-central-1
secret_access_key: $secret_access_key
skip_cleanup: true
View before_script.yml
before_script:
- "echo 'Before Script - Started'"
- "echo -e \"machine github.com\\n login $CI_USER\\n password $CI_USER_PASSWORD\" > ~/.netrc"
- "sudo apt update"
- "sudo apt install npm"
- "sudo npm install --g lerna"
- "sudo npm install"
- "sudo ln -s /home/travis/.nvm/versions/node/v14.4.0/bin/node /usr/bin/node"
- "node --version"
View language_code.yml
language: node_js
node_js:
- 14.4.0
View before_install.yml
before_install:
- "echo \"Set password from Env Variables\""
- "echo -e \"machine github.com\\n login $CI_USER\\n password $CI_USER_PASSWORD\" > ~/.netrc"
- "git submodule update --init --recursive"
- "npm i -g lerna"
- "echo \"before install ended !!!!\""
View final-app.js
import React from 'react';
import './App.css';
import { useSelector } from "react-redux";
import { useDispatch } from "react-redux";
function App() {
const globalState = useSelector(state => state);
const dispatch = useDispatch();
const getUserData = () => {
// Get the Data for the User
View results-after-search-result.json
{
"code":"0",
"message":"Success",
"payload":{
"itemDTOs":[
{
"id":1,
"price":600089,
"unitSize":"4",
"name":"MamyPoko X-tra Kering - NB-S 44 - Popok Perekat updated",
View products-original-result.json
{
"code":"0",
"message":"Success",
"payload":[
{
"id":1,
"price":600089,
"unitSize":"4",
"name":"MamyPoko X-tra Kering - NB-S 44 - Popok Perekat updated",
"sellerName":"Ibu and Bayi",
@tarun-nagpal-github
tarun-nagpal-github / js-interview-puzzles.js
Last active Mar 26, 2020
JavaScript - Interview Puzzles
View js-interview-puzzles.js
// What is the output and Why
const myData = [1,2,3,4];
console.log(myData[4]);
// Answer - undefined
// What is the code below doing and how we can optimize it
const items = document.querySelctorAll('#container > div');
items.forEach(el => {
@tarun-nagpal-github
tarun-nagpal-github / data-structure-and-logical.js
Last active Mar 19, 2020
Logical and Data Structure Questions
View data-structure-and-logical.js
// Increment Questions
x = 5;
y = ++x;
z = y++;
console.log(x);
console.log(y);
console.log(z);
// String and number compare
You can’t perform that action at this time.