Skip to content

Instantly share code, notes, and snippets.

View UnitedWithCode's full-sized avatar
🎯
Focusing

Prateek Sharma UnitedWithCode

🎯
Focusing
View GitHub Profile
@UnitedWithCode
UnitedWithCode / docker-help.md
Created June 9, 2021 05:04 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@UnitedWithCode
UnitedWithCode / submit.md
Created June 4, 2021 11:02 — forked from tanaikech/submit.md
Adding Query Parameters to URL using Google Apps Script

Adding Query Parameters to URL using Google Apps Script

This is for adding the query parameters to the URL. This sample script is prepared by ES5. So this can be also used for Javascript. When I created an endpoint with some query parameters, I had used the scripts of various patterns every time. Today, I prepared this sample script to unify them. If this is also useful for you, I'm glad.

Sample script :

String.prototype.addQuery = function(obj) {
  return this + Object.keys(obj).reduce(function(p, e, i) {
    return p + (i == 0 ? "?" : "&") +
      (Array.isArray(obj[e]) ? obj[e].reduce(function(str, f, j) {
 return str + e + "=" + encodeURIComponent(f) + (j != obj[e].length - 1 ? "&" : "")