Skip to content

Instantly share code, notes, and snippets.

View santoshtechwiz's full-sized avatar

santosh kumar singh santoshtechwiz

View GitHub Profile
// Ad server script
(function () {
// Function to parse query string parameters
function getQueryParam(name) {
const urlParams = new URLSearchParams(window.location.search);
return urlParams.get(name);
}
// Retrieve parameters from the query string
// contentInjector.js
(function () {
const containerId = 'injected-content-container';
const container = document.createElement('div');
container.id = containerId;
document.body.appendChild(container);
// Fetch posts from JSONPlaceholder API
const fetchData = async () => {
@santoshtechwiz
santoshtechwiz / index.html
Created November 29, 2023 07:08
Read Rss feed
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
font-family: 'Arial', sans-serif;
margin: 0;
padding: 0;
@santoshtechwiz
santoshtechwiz / blog.js
Created November 20, 2023 02:40
Blogger
const months = ["Angular", "Jest", "C%23", "Algorithms","design%20pattern","ASP.NET","Data%20Structure","Security","blazor"];
var label = months[Math.floor(Math.random() * months.length)];
var currentPostId = document.getElementById('blogurl').innerHTML;
var maxPosts = 6; // Adjust the number of related posts to display
// Fetch related posts using Blogger JSON Feed
function fetchRelatedPosts() {
var script = document.createElement('script');
script.src = '/feeds/posts/default/-/' + label + '?alt=json&callback=handleRelatedPosts';
@santoshtechwiz
santoshtechwiz / data.json
Last active June 21, 2022 06:53
Blazor Json
{
"component": "InputText",
"parameters": {
"value": "JSON Title"
}
}
function helloWorld(name){
alert("hellp"+name);
}
@santoshtechwiz
santoshtechwiz / min.cs
Created January 27, 2022 03:17
MinCost
void Main()
{
MinCost("abccbd",new[]{0, 1, 2, 3, 4, 5});
MinCost("aabbcc",new[]{1, 2, 1, 2, 1, 2});
MinCost("aaaa",new[]{3, 4, 5, 6});
MinCost("ababa",new[]{10, 5, 10, 5, 10});
@santoshtechwiz
santoshtechwiz / CFunction.g4
Created December 22, 2021 08:38 — forked from mattmcd/CFunction.g4
ANTLR4 version of Wrapper Generator
grammar CFunction;
function : retType name args ;
args : '(' arg (',' arg)* ')' ;
arg
: 'double' name # SCALAR_ARG
| 'double' '*' name # ARRAY_ARG
void Main()
{
var room = new Room();
room.People.Add(new Person() { Name = "MyName", Age = 21 });
room.People.Add(new Staff() { Name = "Father", Age = 40, Salary = 10000 });
room.People.Add(new Person() { Name = "Mother", Age = 40 });
room.Show();
}
<UserSettings><ApplicationIdentity version="16.0"/><ToolsOptions><ToolsOptionsCategory name="Environment" RegisteredName="Environment"><ToolsOptionsSubCategory name="General" RegisteredName="General" PackageName="Visual Studio Environment Package">
<PropertyValue name="AnimationSpeed">7</PropertyValue>
<PropertyValue name="AutoAdjustExperience">true</PropertyValue>
<PropertyValue name="AutohidePinActiveTabOnly">false</PropertyValue>
<PropertyValue name="CloseButtonActiveTabOnly">true</PropertyValue>
<PropertyValue name="MRUListContainsNItems">10</PropertyValue>
<PropertyValue name="ShowStatusBar">true</PropertyValue>
<PropertyValue name="WindowMenuContainsNItems">10</PropertyValue>
</ToolsOptionsSubCategory><ToolsOptionsSubCategory name="ProjectsAndSolution" RegisteredName="ProjectsAndSolution" PackageName="Visual Studio Environment Package"><PropertyValue name="ProjectsLocation">%vsspv_user_appdata%\Source\Repos</PropertyValue><PropertyValue name="PromptForRenameSymbol">true</P