Skip to content

Instantly share code, notes, and snippets.

@onkar-singh
onkar-singh / Optimized SEO header for Blogger
Created November 29, 2022 13:24 — forked from eneajaho/Optimized SEO header for Blogger
This Optimized SEO header for Blogger will rank you higher in search results.
<!-- [ Meta Tag SEO ] -->
<include expiration='7d' path='*.css'/>
<include expiration='7d' path='*.js'/>
<include expiration='3d' path='*.gif'/>
<include expiration='3d' path='*.jpeg'/>
<include expiration='3d' path='*.jpg'/>
<include expiration='3d' path='*.png'/>
<meta content='sat, 02 jun 2020 00:00:00 GMT' http-equiv='expires'/>
<meta charset='utf-8'/>
<meta content='width=device-width, initial-scale=1' name='viewport'/>
@onkar-singh
onkar-singh / primitive-reference-types-javascript.md
Created November 25, 2022 10:49 — forked from branneman/primitive-reference-types-javascript.md
Primitive Types & Reference Types in JavaScript

Primitive Types & Reference Types in JavaScript

An explanation of JavaScript's pass-by-value, which is unlike pass-by-reference from other languages.

Facts

  • JavaScript has 2 kinds of variable types: primitive and reference.
  • A fixed amount of memory is reserved after creation of every variable.
  • When a variable is copied, it's in-memory value is copied.
  • Passing a variable to a function via a call also creates a copy of that variable.

Primitive Types

@onkar-singh
onkar-singh / submit.md
Created September 23, 2022 14:14 — forked from tanaikech/submit.md
Taking Advantage of TextFinder for Google Spreadsheet

Taking Advantage of TextFinder for Google Spreadsheet

There is Class TextFinder in Spreadsheet service for Google Apps Script. Ref The TextFinder can search and replace the texts in the Spreadsheet using Google Apps Script. There is the method for createTextFinder in Class Spreadsheet, Class Sheet and Class Range. When these methods are used, you can search and replace the texts for all sheets in a Spreadsheet, the specific sheet, and the specific range in the specific sheet.

In this post, I would like to introduce the sample scripts for taking advantage of TextFinder.

I think that TextFinder is the strong method for searching values in Google Spreadsheet. Ref So I think that when this can be taken advantage of, the process cost of the script will become low.

Sample script 1

1 2 3
first second third
2
22
22
third x
console.log("=========Array=========");
var nm = ["om","km","lk","dj"]; //array
nm[2]="gh"; // change value
nm.push("Lemon1"); // adds a new element from last
nm[nm.length-3] = "Lemon2"; // adds a new element from last
nm.pop(); // Removes & returns the value of last element
nm.push("Kiwi"); // Adds & returns the value of last element
nm.shift(); // Removes & returns the value of first element
nm.unshift("Lemon"); // Adds a new element & returns the value of first element
delete nm[1]; //delete
http://compose.mail.yahoo.com/?to={email_address}&subject={title}&body={url}
http://digg.com/submit?url={url}
http://pinterest.com/pin/create/link/?url={url}
http://service.weibo.com/share/share.php?url={url}&appkey=&title={title}&pic=&ralateUid=
http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url={url}
http://surfingbird.ru/share?url={url}&description={text}&screenshot={image}&title={title}
http://vk.com/share.php?url={url}&title={title}&comment={text}
http://widget.renren.com/dialog/share?resourceUrl={url}&srcUrl={url}&title={title}&description={text}
http://www.addthis.com/bookmark.php?url={url}
http://www.douban.com/recommend/?url={url}&title={title}
http://compose.mail.yahoo.com/?to={email_address}&subject={title}&body={url}
http://digg.com/submit?url={url}
http://pinterest.com/pin/create/link/?url={url}
http://service.weibo.com/share/share.php?url={url}&appkey=&title={title}&pic=&ralateUid=
http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url={url}
http://surfingbird.ru/share?url={url}&description={text}&screenshot={image}&title={title}
http://vk.com/share.php?url={url}&title={title}&comment={text}
http://widget.renren.com/dialog/share?resourceUrl={url}&srcUrl={url}&title={title}&description={text}
http://www.addthis.com/bookmark.php?url={url}
http://www.douban.com/recommend/?url={url}&title={title}
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<style type="text/css">
h1 {display: inline-block;}
.qw1 img{padding:5px;}
</style>
<body>
ftp://192.168.1.23:3721/
var X = document.getElementById("intro");
var x = document.getElementsByTagName("p");
var x = document.getElementsByClassName("intro");
var x = document.querySelectorAll("p.intro");
element.innerHTML = new html content || Exam:- object.innerHTML/.innerText/.textContent = "<p>Dog</p>";
@onkar-singh
onkar-singh / JS Selectors
Created July 22, 2018 10:45
JS Selectors
var X = document.getElementById("intro");
var x = document.getElementsByTagName("p");
var x = document.getElementsByClassName("intro");
var x = document.querySelectorAll("p.intro");
element.innerHTML = new html content // Exam:- object.innerHTML/.innerText/.textContent = "<p>Dog</p>";
element.attribute = new value // Exam:- object.src = "landscape.jpg";
element.style.property=newstyle // Exam:- object.style.color="blue";
element.setAttribute(attribute, value) // Exam:- object.setAttribute("style", "background-color: red;");
element.removeAttribute(attributename) // Exam:- object.removeAttribute("href");