Skip to content

Instantly share code, notes, and snippets.


Narendra Sisodiya nsisodiya

View GitHub Profile
nsisodiya / fix-version-lock.js
Last active Sep 30, 2020
View fix-version-lock.js
const fs = require('fs');
const YAML = require('yamljs');
const replaceFirstLineOfFile = require('file-firstline-replace');
const pkgJson = require('../../package.json');
var filename = 'Dockerfile';
var newHeader = `FROM node:${pkgJson.nodeVersionLock} as builder\n`;
replaceFirstLineOfFile(filename, newHeader, function (error) {
if (error) {
throw error;
nsisodiya / preinstall.js
Created Sep 30, 2020
View preinstall.js
const pkgJson = require('../../package.json');
const nodeVersion = process.versions.node;
let err = false;
if (pkgJson.nodeVersionLock !== nodeVersion) {
console.error(`Please use node ${pkgJson.nodeVersionLock}. Try
nvm install v${pkgJson.nodeVersionLock}
nvm reinstall-packages v${nodeVersion}
nvm uninstall v${nodeVersion}
View genBuildFileSize.js
const fs = require('fs').promises;
const path = require('path');
const prettyBytes = require('pretty-bytes');
const buildDir = 'build';
const blackListedFiles = ['build/git-log.json'];
const blackListedDirs = ['build/report'];
const isArrayHas = (arr, str) => {
const outOfIndex = -1;
nsisodiya / main.js
Created Jul 27, 2020
Split String into multiple unique parts
View main.js
A string s contains only uppercase and lowercase letters.
Break this list into as many parts as possible
so that each letter appears in at most one parts.
Return the list of integers which represent the length of each part.
function findPairs(str) {
var out = [];
View myAdd.ts
type iAdd = (a: number, b: number) => number;
const add: iAdd = (a, b) => a + b;
add(3, 4);
nsisodiya / App.tsx
Last active Apr 25, 2020
React + Google Sheet demo - Step 1
View App.tsx
import React, { useState } from "react";
import "./App.css";
const styles = {
InputBox: {
padding: 4,
Error: {
color: "red",
View .npmrc
View .gitlab-ci.yml
image: node:9-alpine
- lint_test
- build
stage: lint_test
- echo //$SYNGENTA_NPM_TOKEN >> ~/.npmrc
View .gitlab-ci.yml
image: node:9-alpine
- lint_test
- build
stage: lint_test
- echo registry= >> ~/.npmrc
View .zshrc
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/narendrasisodiya/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See
You can’t perform that action at this time.