Skip to content

Instantly share code, notes, and snippets.

View PrashantUnity's full-sized avatar
🎯
Focusing

Prashant Priyadarshi PrashantUnity

🎯
Focusing
View GitHub Profile
@PrashantUnity
PrashantUnity / MaterialColor.cs
Created August 29, 2022 06:39
Setting Random Material color to game object inside unity editor
var newObstacle = Instantiate(cube, new Vector3(i, 0, j), Quaternion.identity, transform);
Renderer obstacleRenderer = newObstacle.GetComponent<Renderer>();
Material mat = new Material(obstacleRenderer.sharedMaterial);
mat.color = GetRandomColor();
obstacleRenderer.sharedMaterial = mat;
//
public Color GetRandomColor()
@PrashantUnity
PrashantUnity / MoveFiles.cs
Created May 7, 2022 06:58
Move Files from one folder to another folder
using System.IO;
using System;
namespace ForGeneral
{
internal class MoveFiles
{
public static void Move()
{
try
@PrashantUnity
PrashantUnity / LeetCodeTreeMaker.cs
Created October 5, 2022 04:01
Will Help in debugging on your local computer
public class Program
{
static void Main(string[] args)
{
var arr = new int[] {1,2,3,4,5,6,7,8,9};
var tree = new LeetCodeTree().MakeTree(arr);
BFS(tree);
}
}
public class LeetCodeTree
using System;
using System.Diagnostics;
using System.IO;
using System.Text;
namespace CpuUses
{
class Program
{
static PerformanceCounter cpuCounter;
<!DOCTYPE html>
<html lang="en">
<head>
<title>HighLight Js Example </title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/styles/default.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/highlight.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"
@PrashantUnity
PrashantUnity / Tries.cs
Created April 3, 2023 04:31
Trie Data Structure
public class Node
{
public Dictionary<char,Node> value { get; set; } = new Dictionary<char,Node>();
public bool IsEndOfWord = false;
}
public class Trie
{
Node node;
public Trie()
{ node = new Node();}
using System;
using System.Diagnostics;
using System.Drawing;
using System.Numerics;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Console;
@PrashantUnity
PrashantUnity / Resume.cs
Created May 16, 2023 08:59
Creating Resume Using CSharp Language and QuestPdf Library
using QuestPDF.Fluent;
using QuestPDF.Helpers;
using QuestPDF.Infrastructure;
using QuestPDF.Previewer;
using SkiaSharp;
QuestPDF.Settings.License = LicenseType.Community;
Document.Create(container =>
{
container
public List<List<int>> ListFromString(string str)
{
return str.Split(']')
.Where(x => x.Length > 0)
.Select(x=> x
.Split(new char[] { '[', ',' })
.Where(m => m.Length > 0)
.Select(m => Convert.ToInt32(m))
.ToList())
.ToList();
[
{
"Product":{
"Name":"Ek Number (No.1) - 1500 Bricks (1 Trailer)",
"Price":"₹14,700.00",
"OriginalPrice":"₹20,700.00",
"PercentDiscount":"30%",
"FrameSize":"10.25 x 5.25 x 3.25 inch",
"BricksSize":"10 x 5 x 3 inch (approx.)",
"Usage":"Wall/Floor/etc.",