Skip to content

Instantly share code, notes, and snippets.

View ismaelhamed's full-sized avatar
🚀
lezduit

Ismael Hamed ismaelhamed

🚀
lezduit
  • Schneider Electric
  • Spain
  • 01:29 (UTC +01:00)
View GitHub Profile

Keybase proof

I hereby claim:

  • I am ismaelhamed on github.
  • I am ismaelhamed (https://keybase.io/ismaelhamed) on keybase.
  • I have a public key ASAzvtc9ecCc98TQx-k2b3DyWtig3huU0vg6lctJSst7-Ao

To claim this, I am signing this object:

@ismaelhamed
ismaelhamed / ActorBenchmarks.cs
Created February 27, 2023 10:19
ActorBenchmarks
[MemoryDiagnoser]
[SimpleJob(targetCount: 5, launchCount: 1, warmupCount: 5)]
public class ActorBenchmarks
{
[Params(100_000, 1_000_000)]
public int ActorCount { get; set; }
private ActorSystem system;
[IterationSetup]
@ismaelhamed
ismaelhamed / Program.cs
Created November 17, 2021 07:30
Elastic.Apm.Extensions.Hosting dependecies mismatch
using Elastic.Apm.DiagnosticSource;
using Elastic.Apm.Extensions.Hosting;
using Microsoft.Extensions.Hosting;
namespace Sample
{
internal static class Program
{
private static void Main(string[] args)
{
@ismaelhamed
ismaelhamed / HelloAkkaHttpServer.cs
Last active March 29, 2021 06:30
Hello Akka Http Server
internal class Program
{
private static readonly HttpResponse NotFound = HttpResponse.Create()
.WithStatus(404)
.WithEntity("Unknown resource!");
public static void Main(string[] _)
{
var system = ActorSystem.Create("HelloAkkaHttpServer");
var cs = CoordinatedShutdown.Get(system);
@ismaelhamed
ismaelhamed / QuarantinedNodesExtension.cs
Last active March 18, 2021 06:47
An extension to monitor whether we have been quarantined
public class QuarantinedNodesExtension : IExtension
{
private readonly ExtendedActorSystem system;
private readonly IActorRef listener;
public QuarantinedNodesExtension(ExtendedActorSystem system)
{
this.system = system;
listener = system.SystemActorOf(Props.Create<QuarantinedNodesListener>().WithDeploy(Deploy.Local), "QuarantinedNodesListener");
}
@ismaelhamed
ismaelhamed / rebaselock.pre-rebase.ps1
Last active September 29, 2016 05:47 — forked from uasi/rebaselock.pre-rebase.sh
A pre-rebase hook that refuses to rebase if "branch.${BRANCH}.rebaselock" is true.
git config branch.master.rebaselock true
@ismaelhamed
ismaelhamed / BundleConfig.cs
Created July 11, 2014 11:20
Bundling AngularJS Templates with ASP.NET MVC
using System.Web.Optimization;
namespace NgTemplateBundling
{
using NgTemplateBundling.Bundling;
public class BundleConfig
{
public static void RegisterBundles(BundleCollection bundles)
{
@ismaelhamed
ismaelhamed / HtmlExtensions.cs
Last active August 29, 2015 14:03
Leveraging AngularJS built-in XSRF protection with ASP.NET MVC
using System.Web.Helpers;
namespace System.Web.Mvc
{
public static class HtmlExtensions
{
const string AntiForgeryCookieName = "XSRF-TOKEN";
public static IHtmlString AngularJSAntiForgeryToken(this HtmlHelper html)
{
@ismaelhamed
ismaelhamed / PasswordCredential.cs
Last active August 29, 2015 14:01
PasswordVault class implementation for Windows Phone (Silverlight)
using System;
using System.Collections.Generic;
#if WINDOWS_PHONE_8
namespace Windows.Security.Credentials
#else
namespace System.Security.Credentials
#endif
{
/// <summary>
@ismaelhamed
ismaelhamed / FacadesExtensions.cs
Last active August 29, 2015 13:56
Telerik's Everlive SDK for Windows Phone 7.5 is missing ExecuteAsync and TryExecuteAsync methods, and thus support for await/async calls.
using System.Threading.Tasks;
using Telerik.Everlive.Sdk.Core.Result;
namespace Telerik.Everlive.Sdk.Core.Facades
{
public static class FacadesExtensions
{
public static Task<T> ExecuteAsync<T>(this AsyncFacade<T> facade)
{
var tcs = new TaskCompletionSource<T>();