Skip to content

Instantly share code, notes, and snippets.

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

Ali Süleyman Topuz alisuleymantopuz

🏠
Working from home
View GitHub Profile
@alisuleymantopuz
alisuleymantopuz / EnumerableExtensions.cs
Created February 7, 2023 12:54
A helper library extension for enumerables.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace dotnet_helpers_linq
{
/// <summary>
/// Contains helpers extension methods for <see cref="IEnumerable{T}"/>
@alisuleymantopuz
alisuleymantopuz / technical-architecture-characteristics-cheatsheet.md
Last active December 10, 2022 21:32
technical-architecture-characteristics-cheatsheet

Technical Architecture Characteristics Cheatsheet

Technical Architecture Characteristics Cheatsheet

@alisuleymantopuz
alisuleymantopuz / example-ppcontroller.cs
Created December 5, 2022 22:21
mongodb-group-documents-key-groupKey-net-core
using System.Linq.Expressions;
using Microsoft.AspNetCore.Mvc;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Driver;
namespace mongodbapiexample.Controllers;
[ApiController]
[Route("[controller]")]
@alisuleymantopuz
alisuleymantopuz / ravenDb-push-notification-index.js
Last active July 14, 2022 20:31
A gist to check how ravenDb changes api push notification service works
// Push Notifications for tracking changes on RavenDB entities Explained
// The Changes API is a Push Notifications service,
// that allows a RavenDB Client to receive messages from a RavenDB Server regarding events that occurred on the server.
// Being able to reach your visitors without any kind of effort
// server -> request -> push service -> message arrives
// capabilities of push notifications
// Web Push Notifications are used for simple tasks like alerting a user about upcoming sales or events.
// They display an icon and a few lines of text that the user can then click to open and
// go to a specific destination on your site
public class ShoppingBasketTests
{
[Fact]
public async Task ShoppingBasket_DiscountSuccess()
{
var discounts = DiscountsFactory.CreateDiscounts();
var basket = new ShoppingBasket(discounts);
@alisuleymantopuz
alisuleymantopuz / DisableAnalyticsCookieProcessor.cs
Created November 19, 2020 19:30
block-sitecore-analytics-pipeline
public class DisableAnalyticsCookieProcessor
{
public virtual void Process(PipelineArgs args)
{
try
{
Assert.ArgumentNotNull(args, "args");
if (!IsCookieAccepted())
{
{
"short_name": "doviz",
"name": "doviz - exchange rates",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="./favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="doviz - exchange rates - Search... (type the currency code such as EUR, USD, TRY)"
// cache stands for storage of the browser
const CACHE_NAME = "version-1";
const urlsToCache = ['index.html', 'offline.html'];
const self = this;
self.addEventListener('install', (event) => {
console.log('open cache');
event.waitUntil(caches.open(CACHE_NAME).then((cache) => {
return cache.addAll(urlsToCache);
}))
});
import axios from 'axios';
const URL = "https://api.exchangeratesapi.io/latest";
export const fetchExchangeRates = async (query) => {
const { data } = await axios.get(URL, {
params: {
base: query
}
});