Skip to content

Instantly share code, notes, and snippets.

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

İsmail Kundakcı ismkdc

🏠
Working from home
View GitHub Profile
@ismkdc
ismkdc / sysctl.conf
Created January 8, 2020 09:04 — forked from kgriffs/sysctl.conf
Linux Web Server Kernel Tuning
# Configuration file for runtime kernel parameters.
# See sysctl.conf(5) for more information.
# See also http://www.nateware.com/linux-network-tuning-for-2013.html for
# an explanation about some of these parameters, and instructions for
# a few other tweaks outside this file.
#
# See also: https://gist.github.com/kgriffs/4027835
#
# Assumes a beefy machine with lots of network bandwidth
Privacy Policy
built the Math For Kids - Solving Game app as a Free app. This SERVICE is provided by at no cost and is intended for use as is.
This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.
If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.
The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at Math For Kids - Solving Game unless otherwise defined in this Privacy Policy.
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
/**
* Respond to the request
* @param {Request} request
*/
async function handleRequest(request) {
export const CalcMachine = () => {
let state = '';
const operators = ['+', '-', '*', '/'];
const sumReducer = (acc, value) => acc + value;
const mulReducer = (acc, value) => acc * value;
const divReducer = (acc, value) => acc / value;
const subReducer = (acc, value) => acc - value;
const sum = (args) => args.reduce(sumReducer);
public class ExceptionMiddleware
{
private readonly RequestDelegate _next;
public ExceptionMiddleware(RequestDelegate next)
{
_next = next;
}
public async Task Invoke(HttpContext context, ILogger<ExceptionMiddleware> logger)
public class CustomErrors
{
public static CustomError E_100 = new(nameof(E_100), "Beklenmedik bir sistem hatası oluştu!");
public static CustomError E_200 = new(nameof(E_200), "Kullanıcı adı veya parola hatalı!");
public static CustomError E_201 = new(nameof(E_201), "Eposta zaten kayıtlı!");
public static CustomError E_202 = new(nameof(E_202), "Bütün alanları doldurunuz!");
public class CustomException : Exception
{
public CustomException(CustomError customError)
{
CustomError = customError;
}
public CustomError CustomError { get; set; }
}
public static class EFQueryExtensions
{
public static async Task<T[]> ToArrayAsyncWithCache<T>(this IQueryable<T> query,
IRedisClient cache, string key, TimeSpan expire = default)
{
var cachedData = await cache.Db0.GetAsync<T[]>(key, CommandFlags.PreferReplica);
if (cachedData != null) return cachedData;
var data = await query.ToArrayAsync();
using System.Linq;
using FastExpressionCompiler;
using Mapster;
namespace foobar;
public static class MappingConfiguration
{
public static TypeAdapterConfig Generate()
{
@ismkdc
ismkdc / fcc.cs
Last active September 5, 2023 17:55
fcc
using System.ComponentModel;
using System.Globalization;
using AutoMapper;
using FastExpressionCompiler;
using Mapster;
using Nelibur.ObjectMapper;
using RunTimeMapping.Models;
using RunTimeMapping.Models.MapperlyMappers;