Skip to content

Instantly share code, notes, and snippets.

View LazZiya's full-sized avatar
🏠
Working from home

Ziya Mollamahmut LazZiya

🏠
Working from home
View GitHub Profile
@davepcallan
davepcallan / GlobalExceptionHandler.cs
Last active March 4, 2024 13:42
ASP.NET 8 Global exception handling with IExceptionHandler example
using Microsoft.AspNetCore.Diagnostics;
namespace Samples;
public class GlobalExceptionHandler(ILogger<GlobalExceptionHandler> logger) : IExceptionHandler
{
public ValueTask<bool> TryHandleAsync(
HttpContext httpContext,
Exception exception,
CancellationToken cancellationToken)
export const getThumbnail = (id, size = 300) =>
`https://drive.google.com/thumbnail?id=${id}&sz=${size}`;
export const getIcon = (mimeType) =>
`https://drive-thirdparty.googleusercontent.com/256/type/${mimeType}`;
export const getFile = (id) => `https://drive.google.com/uc?id=${id}`;
const downloadFile = (id) =>
@amilos
amilos / KebabCaseNamingStrategy.cs
Created October 9, 2017 16:56
Kebab case naming strategy extension for Newtonsoft.JSON library
using System.Text;
using Newtonsoft.Json.Serialization;
namespace Asseco.JsonUtils
{
// Adapted from SnakeCaseNamingStrategy from Newtonsoft.Json library
public class KebabCaseNamingStrategy : NamingStrategy
{
const char HYPHEN = '-';
const char UNDERSCORE = '_';
@joyrexus
joyrexus / README.md
Last active February 24, 2024 15:16
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@DanDiplo
DanDiplo / JS-LINQ.js
Last active May 7, 2024 14:27
JavaScript equivalents of some common C# LINQ methods. To help me remember!
// JS array equivalents to C# LINQ methods - by Dan B.
// First: This version using older JavaScript notation for universal browser support (scroll down for ES6 version):
// Here's a simple array of "person" objects
var people = [
{ name: "John", age: 20 },
{ name: "Mary", age: 35 },
{ name: "Arthur", age: 78 },
{ name: "Mike", age: 27 },