Skip to content

Instantly share code, notes, and snippets.

View sumitridhal's full-sized avatar
💭
I may be slow to respond.

Sumit Ridhal sumitridhal

💭
I may be slow to respond.
View GitHub Profile
@sumitridhal
sumitridhal / openshift-cheatsheet.md
Created February 15, 2023 07:32 — forked from rafaeltuelho/openshift-cheatsheet.md
My Openshift Cheatsheet

My Openshift Cheatsheet

Project Quotes, Limits and Templates

  • Cluster Quota
oc create clusterquota env-qa \
    --project-label-selector environment=qa \
    --hard pods=10,services=5
    
oc create clusterquota user-qa \
let sum = 0;
const elss = async () => {
for (const f of a.folios) {
for (const s of f.schemes) {
const res = await fetch(`https://api.mfapi.in/mf/${s.amfi}`).then(response => response.json());
if(res.meta.scheme_category.indexOf('ELSS') > -1) {
sum += s.transactions.reduce((x, t) => {
return t.type.startsWith('PURCHASE') ? x + Number(t.amount) : x;
}, 0);
}
@sumitridhal
sumitridhal / regex-date-parse.js
Created December 2, 2020 18:28
RegEx Date parse and validation
const f = 'MM/DD/YYYY';
const d = '11';
const arr = f.split('/');
const a = d.match(/([0-9]{1,2})?\/?([0-9]{1,2})?\/?([0-9]{2,4})?/);
const [DD,MM,YYYY] = [a[arr.indexOf('DD')+1] || 01, a[arr.indexOf('MM')+1] || 01,a[arr.indexOf('YYYY')+1] || 2001];
new Date(MM+'/'+DD+'/'+YYYY);
@sumitridhal
sumitridhal / package.json
Last active October 16, 2018 18:03
webpack
{
"name": "webpack-sass",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "webpack-dev-server --config webpack.config.js",
"dev": "webpack --config webpack.config.js -p --mode development --watch",
"build": "webpack --mode production"
},
@charset "UTF-8";
/*-------------------------------------------------------------------------------------------------------------------------------*/
/*This is main CSS file that contains custom style rules used in this template*/
/*-------------------------------------------------------------------------------------------------------------------------------*/
@sumitridhal
sumitridhal / index.html
Created July 10, 2017 14:04
React CURD
<div id="app"></div>
<div id="particles-js"></div>
@sumitridhal
sumitridhal / README.md
Last active April 28, 2017 07:53
Vue CURD
@sumitridhal
sumitridhal / angular-curd.markdown
Last active April 28, 2017 06:11
Angular CURD