Skip to content

Instantly share code, notes, and snippets.

View arruw's full-sized avatar
Aaaaaaa...

mmav arruw

Aaaaaaa...
  • Earth
View GitHub Profile
@arruw
arruw / Main.java
Last active July 24, 2021 19:17
Simple Rate Limiter implementation in Java
import java.util.*;
import java.util.concurrent.*;
public class Main {
public static void main(String[] args) throws Exception {
String[] clientIds = new String[] {
"abc-1",
"def-2",
@arruw
arruw / backup.ps1
Last active February 10, 2019 20:05
Backup Docker named volumes (Docker for Windows)
param (
[Parameter(Mandatory = $true, HelpMessage = "List all named volumes you want to backup. <volume1,volume2,volume3>")]
[string[]] $Volumes,
[Parameter(Mandatory = $true, HelpMessage = "Backup path")]
[string] $Path
)
$ErrorActionPreference = "Stop"
"Checking volumes..."
@arruw
arruw / CheckPolicyFilterFactoryAttribute.cs
Created October 2, 2018 07:39
Check policy action filter that uses ModelState to bind values to it
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using System;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
namespace Performa365.Web.Utils.Filters
{
public class CheckPolicyFilter : IAsyncActionFilter
@arruw
arruw / data.json
Last active October 28, 2021 03:15
Ajax over CORS proxy example - https://goo.gl/nP6eRV
{
"message": "Hello World!"
}
@arruw
arruw / ApiController.cs
Last active March 24, 2021 22:05
ASP.NET Core - Generic web API controller with generic repository pattern (created on, modified on, soft delete) ... view demo https://github.com/matjazmav/generic-api
[Authorize]
[Route("api/[controller]")]
public abstract class ApiController<T> : Controller where T : class, IEntity
{
private IApplicationRepository<T> _repository;
public ApiController(IApplicationRepository<T> repository)
{
_repository = repository;
}
@arruw
arruw / demo.md
Last active June 15, 2016 09:55
Share Buttons HTML + CSS + DEMO

demo.png