Skip to content

Instantly share code, notes, and snippets.

View SannketPatel's full-sized avatar

Sanket Patel SannketPatel

View GitHub Profile
@SannketPatel
SannketPatel / browser-console-json-ld
Created October 29, 2024 07:06
TO GET JSON-LD element from html page in console browser
// Get all script tags with type 'application/ld+json'
const jsonLdScripts = Array.from(document.querySelectorAll('script[type="application/ld+json"]'));
// Parse and log each JSON-LD script content
const jsonLdData = jsonLdScripts.map(script => {
try {
return JSON.parse(script.textContent);
} catch (e) {
console.error("Error parsing JSON-LD:", e);
return null;
@SannketPatel
SannketPatel / simple_html-css-spinner.txt
Created October 4, 2024 10:24
SIMPLE HTML CSS SPINNER
<div class="spinner"></div>
<style>
.spinner {
border: 4px solid rgba(0, 0, 0, 0.1); /* Light gray border */
border-left-color: #000; /* Darker border on one side */
border-radius: 50%; /* Make it a circle */
width: 40px; /* Width of the spinner */
height: 40px; /* Height of the spinner */
animation: spin 1s linear infinite; /* Animation with continuous spinning */
@SannketPatel
SannketPatel / VisitorsCountryBasedonIP-ShopifyStore-Javascript
Last active September 29, 2023 13:47
Get Two character code of Country Code of Visitor based on IP in Shopify store - Javascript code
fetch("/browsing_context_suggestions.json").then(s=>s.json()).then(s=> console.log(s.detected_values.country.handle));
@SannketPatel
SannketPatel / DatabaseComparision.cs
Created July 15, 2023 13:53
COMPARE TWO MSSQL SERVER DATABASE AND FIND MISSING FIELD FROM SECOND DATABASE
using Microsoft.Data.SqlClient;
using System.Data;
public class DatabaseComparision
{
public void Main()
{
// Connection string parameters for database 1
string server1 = "LAPTOP\\SQLSERVER";
string database1 = "TESTDB";