Skip to content

Instantly share code, notes, and snippets.

View ismaelhamed's full-sized avatar
🚀
lezduit

Ismael Hamed ismaelhamed

🚀
lezduit
  • Spain
  • 09:10 (UTC +02:00)
View GitHub Profile
@Aaronontheweb
Aaronontheweb / AzureBootstrapper.cs
Created October 12, 2015 14:09
Akka.NET Cluster Bootstrapper
namespace WebCrawler.AzureBootstrap
{
public static class AzureRuntimeBootLoader
{
public static async Task<Config> CreateRuntimeConfig(string seedRoleName, string akkaEndpoint)
{
// Need to wait until at least 1 instance of our seed role is up and available
while(!IsSeedRoleAvailable(seedRoleName))
{
await Task.Delay(TimeSpan.FromSeconds(1.5));
@nicholasdille
nicholasdille / Show-JobProgress.ps1
Last active December 30, 2021 20:38
Retrieve progress from PowerShell job and display progress bar
function Show-JobProgress {
[CmdletBinding()]
param(
[Parameter(Mandatory,ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.Job[]]
$Job
,
[Parameter()]
[ValidateNotNullOrEmpty()]
@rmacfie
rmacfie / MediatRExtensions.cs
Last active June 23, 2024 01:18
Register MediatR handlers in Asp.Net 5 / vNext / Core
namespace Microsoft.AspNet.Builder
{
public static class MediatRExtensions
{
public static IServiceCollection AddMediatR(this IServiceCollection services, params Assembly[] handlerAssemblies)
{
services.AddTransient<IMediator>(x => new Mediator(x.GetService<SingleInstanceFactory>(), x.GetService<MultiInstanceFactory>()));
services.AddTransient<SingleInstanceFactory>(x => t => x.GetRequiredService(t));
services.AddTransient<MultiInstanceFactory>(x => t => x.GetServices(t));
@PurpleBooth
PurpleBooth / README-Template.md
Last active April 18, 2025 02:49
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@JakeGinnivan
JakeGinnivan / gitflow-overview.puml
Last active July 2, 2024 13:51
Overview of GitFlow and versions generated by GitVersion
@startuml
participant "pull/2/merge" as feature
participant develop
participant "release/2.0.0" as majorRelease
participant "release/1.3.0" as minorRelease
participant master
activate develop
activate master
master -> master: commit
master -> master: tag 1.2.0
@thpham
thpham / haproxy.conf
Last active February 28, 2024 07:41
test config haproxy for gRPC loadbalancing
global
tune.ssl.default-dh-param 1024
defaults
timeout connect 10000ms
timeout client 60000ms
timeout server 60000ms
frontend fe_http
mode http
@jawadatgithub
jawadatgithub / OIDC and OAuth2 Flows.md
Last active February 11, 2024 23:15
Enrich IdentityServer3 Documentation with OIDC (OpenID Connect) and OAuth2 Flows section
Note for community:

A. IdentityServer3 docs, samples and source code use OIDC & OAuth2 terms interchangeably to refer to same thing in many areas. I think that's make sense because OIDC introduced as complement & extension for OAuth2.

B. IdentityServer3, STS, OP, OIDC server, OAuth2 server, CSP, IDP and others: means same thing (software that provide/issue tokens to clients) as explained in [Terminology] (http://identityserver.github.io/Documentation/docs/overview/terminology.html).

C. Grants and flows mean same thing, grant was the common term in OAuth2 specs and flow is the common term in OIDC specs.

D. This document will not focus on custom flow/grant.

E. [Important] Choosing wrong flow leads to security threat.

@rogeralsing
rogeralsing / gist:d05e4b7cc64a3cfff3b8
Last active March 4, 2018 11:44
Durable Messagebus integration with Akka and Azure Servicebus
using System;
using System.Linq;
using System.Threading.Tasks;
using Akka.Actor;
using Akka.Routing;
using Microsoft.ServiceBus.Messaging;
namespace ConsoleApplication13
{
public class MyBusinessActor : ReceiveActor
@mefellows
mefellows / bootstrap.ps1
Last active April 6, 2018 01:06
Bootstrap Vagrant + Packer for Windows Development and Automation
try {
Write-Host -ForegroundColor green "Bootstrapping machine ${remoteHost}"
Write-Host "Setting up package management and installing required packages for Dev."
# Install Choco (if not already installed) + required packages
if ( (Get-Command "choco" -errorAction SilentlyContinue) ) {
Write-Host "Chocolatey already installed. Skipping."
} else {
Write-Host "Installing Chocolatey"
$wc=new-object net.webclient; $wp=[system.net.WebProxy]::GetDefaultProxy(); $wp.UseDefaultCredentials=$true; $wc.Proxy=$wp; iex ($wc.DownloadString('https://chocolatey.org/install.ps1'))
@sandcastle
sandcastle / oracle_guid_helpers.sql
Last active December 9, 2024 13:48
Oracle GUID helper functions for converting between GUID and RAW(16)
set serveroutput on;
declare
raw_guid raw(16);
guid varchar2(64);
begin
raw_guid := guid_to_raw ('88c6a267-65d2-48d6-8da2-6f45e2c22726');
guid := raw_to_guid('67A2C688D265D6488DA26F45E2C22726');