Skip to content

Instantly share code, notes, and snippets.

@debashish2014
debashish2014 / gist:beac069583326c80c585d1c2c1591370
Created April 2, 2025 11:26 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
##
# Configure the Azure Provider
##
provider "azurerm" {
version = "=2.8.0"
features {}
}
##
# Define variables for location, service principal for AKS and Bastion VM Admin
@debashish2014
debashish2014 / race-wait-first-three.cs
Last active July 6, 2022 15:51
race wait first three
void Main()
{
//Lower the Fatigue, the faster player will run
Race race = new Race();
//Adding the players with the name & fatigue level
race.AddPlayer("A", 100);
race.AddPlayer("B", 84);
race.AddPlayer("C", 30);
race.AddPlayer("D", 50);
@debashish2014
debashish2014 / race-wait-all.cs
Last active April 24, 2021 06:54
race wait all
void Main()
{
//Lower the Fatigue, the faster player will run
Race race = new Race();
//Adding the players with the name & fatigue level
race.AddPlayer("A", 100);
race.AddPlayer("B", 84);
race.AddPlayer("C", 30);
race.AddPlayer("D", 50);
@debashish2014
debashish2014 / convert-to-json.cs
Last active April 23, 2021 16:33
add fields to object dynamically and convert it into json
void Main()
{
Employee employee = new Employee() { FirstName = "Debashish", LastName = "Pal", Salary = 50000 };
Console.WriteLine(employee);
var dynamicFields = new Tuple<string, object>[3];
dynamicFields[0] = Tuple.Create("Phone No", (object) 332847398);
dynamicFields[1] = Tuple.Create("Address", (object) "some dummy address");
dynamicFields[2] = Tuple.Create("Gender", (object) "Male");
@debashish2014
debashish2014 / sum extension.cs
Last active April 22, 2021 16:16
Own version of sum extension method
public static class SumExtensions {
public static int SumEx<T>(this IEnumerable<T> data, Func<T,int> callback)
{
int output = 0;
var enumerator = data.GetEnumerator();
while(enumerator.MoveNext()){
var listItem = (T) enumerator.Current;
var value = callback(listItem);
output += value;
@debashish2014
debashish2014 / sum using linq.cs
Last active April 22, 2021 16:25
sum using linq
void Main()
{
List<Employee> lstEmployees = new List<Employee>{
new Employee{ FirstName = "Mohan", LastName="Dave", Salary = 34000},
new Employee{ FirstName = "Soham", LastName="Pal", Salary = 12300},
new Employee{ FirstName = "Amit", LastName="Atare", Salary = 34478},
new Employee{ FirstName = "Debashish", LastName="Das", Salary = 12500},
new Employee{ FirstName = "Amit", LastName="Arora", Salary = 30000}
};
@debashish2014
debashish2014 / delegates and interface.cs
Last active April 26, 2021 09:57
Solve The Scenario -Delegates & Interfaces
void Main()
{
Report r = new Report(new LineChart());
r.GenerateAndWiteToConsole(10, 20);
r = new Report(new PieChart());
r.GenerateAndWiteToConsole(20,30);
r = new Report(new StackChart());
r.GenerateAndWiteToConsole(30,40);
@debashish2014
debashish2014 / String.toRegExp.js
Created February 19, 2020 13:58 — forked from BrandonZacharie/String.toRegExp.js
A JavaScript function to convert a string to a RegExp
if (!String.toRegExp)
String.toRegExp = function String_toRegExp(pattern, flags) {
return new RegExp(pattern.replace(/[\[\]\\{}()+*?.$^|]/g, function (match) { return '\\' + match; }), flags);
};
@debashish2014
debashish2014 / webpack.common.js
Created February 6, 2020 11:17 — forked from tejasbubane/webpack.common.js
Webpack v4 config - separated dev and prod
"use strict";
const webpack = require("webpack");
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const devMode = process.env.NODE_ENV !== "production";
module.exports = {
entry: ["babel-polyfill", "./src/index.js"],