Skip to content

Instantly share code, notes, and snippets.

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

Afaq Ahmed Khan afaqahmedkhan

🏠
Working from home
View GitHub Profile
@afaqahmedkhan
afaqahmedkhan / All time zone names for moment.js
Created April 15, 2020 22:25
All time zone names for moment.js
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Asmera
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
@afaqahmedkhan
afaqahmedkhan / dnowexceltojson.js
Last active April 8, 2019 07:16
dnow excel sheet to json conversion for internal use
function camelize(str) {
return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function(word, index) {
return index == 0 ? word.toLowerCase() : word.toUpperCase();
}).replace(/\s+/g, '');
}
const cols = 'CUSTOMER,COUNTRY,SITE,FIELD LOCATION,VALVE MANUFACTURER,VALVE BRAND,VALVE TYPE,VALVE SUB TYPE,VALVE MODEL,SHORT TEXT DESCRIPTION,Long Text Description ,OEM MATERIAL NUMBER,Valve Data Sheet,QTY,Bore Type,NPS 1,NPS 2,Bore Size ,Pressure Rating NPS 1,Pressure Rating NPS 2,End Connection 1,End Connection 2,Design Temperarture (Max),Design Temperarture (Min),Operating Temperarture (Max),Operating Temperarture (Min),Body Design,Obturator Design,Seat Design,Body Material,Obturator Material,Seat Ring Material,Seat Insert Material,Stem & Trunnion,Primary Seal Type,Primary Seal Material,Gaskets,Packing,Lockable Device,Anti-Static,Ball Position Indicator,Stem Injection Port,Injection Port/Seat,Vent Plug,Drain Plug,Stem Extension,Overlay on Body,Overlay Material,Actuated/Manual,Operator Man
@afaqahmedkhan
afaqahmedkhan / intermediate-algorithm-scripting-make-a-person.markdown
Created December 25, 2018 06:51
Intermediate Algorithm Scripting: Make a Person
@afaqahmedkhan
afaqahmedkhan / functional-programming-implement-the-filter-method-on-a-prototype.markdown
Created November 24, 2018 07:46
Functional Programming: Implement the filter Method on a Prototype
@afaqahmedkhan
afaqahmedkhan / functional-programming-use-the-filter-method-to-extract-data-from-an-array.markdown
Created November 24, 2018 07:22
Functional Programming: Use the filter Method to Extract Data from an Array
@afaqahmedkhan
afaqahmedkhan / functional-programming-implement-map-on-a-prototype.markdown
Created November 24, 2018 06:19
Functional Programming: Implement map on a Prototype
@afaqahmedkhan
afaqahmedkhan / functional-programming-use-the-map-method-to-extract-data-from-an-array.markdown
Created November 24, 2018 06:09
Functional Programming: Use the map Method to Extract Data from an Array
@afaqahmedkhan
afaqahmedkhan / object-oriented-programming-create-a-method-on-an-object.markdown
Created November 17, 2018 12:39
Object Oriented Programming: Create a Method on an Object
@afaqahmedkhan
afaqahmedkhan / object-oriented-programming-use-dot-notation-to-access-the-properties-of-an-object.markdown
Created November 17, 2018 12:35
Object Oriented Programming: Use Dot Notation to Access the Properties of an Object
@afaqahmedkhan
afaqahmedkhan / object-oriented-programming-create-a-basic-javascript-object.markdown
Created November 17, 2018 12:32
Object Oriented Programming: Create a Basic JavaScript Object