Skip to content

Instantly share code, notes, and snippets.

View ravinsinghd's full-sized avatar

Ravin Singh D ravinsinghd

View GitHub Profile
validateLimit(10);
.
.
.
validateLimit(10);
.
.
.
validateLimit(10);
getCounterLimit(limit=10){
return limit
}
validateLimit(getCounterLimit());
// want to overwrite the value for special case
validateLimit(getCounterLimit(15));
// Approach 1
function getMapping(){
const tagMap = {};
this.selectedTags.forEach(( tag, index ) => {
if ( tag !== undefined ) {
tagMap[ tag ] = this.headers[ index ];
}
} )
return tagMap;
}
@ravinsinghd
ravinsinghd / serviceworker.js
Created January 25, 2018 18:54 — forked from kosamari/serviceworker.js
cache index.html using Service Worker
/*
* CHALLANGE:
* Cache `index.html` file using service worker.
*
* This bit of code is included in <script> tag of index.html
* if (navigator.serviceWorker) {
* navigator.serviceWorker.register('serviceworker.js', {scope: '/'})
* }
*
*/
@ravinsinghd
ravinsinghd / Procfile
Created July 25, 2018 18:06 — forked from jordansissel/Procfile
Jenkins on Heroku
# Only listen on http; disable ajp and https
web: java -jar jenkins.war --httpPort=$PORT --ajp13Port=-1 --httpsPort=-1