Skip to content

Instantly share code, notes, and snippets.

View akamud's full-sized avatar
👳‍♂️

Mahmoud Ali akamud

👳‍♂️
View GitHub Profile
@davidfowl
davidfowl / MinimalAPIs.md
Last active May 8, 2024 02:30
Minimal APIs at a glance
@NickCraver
NickCraver / Microsoft.PowerShell_profile.ps1
Last active March 18, 2024 13:25
Craver's oh-my-posh profile
# This goes in your Microsoft.PowerShell_profile.ps1 (can find the path via $PROFILE in your prompt)
Import-Module -Name posh-git,oh-my-posh,Terminal-Icons
Set-PoshPrompt -Theme craver
@nckroy
nckroy / eran-hammer-oauth2-rant-20120726.md
Created January 21, 2021 00:15
OAuth 2.0 and the Road to Hell

(Scraped from the Internet Wayback Machine. Original content by Eran Hammer / hueniverse.com July 26, 2012)

OAuth 2.0 and the Road to Hell

They say the road to hell is paved with good intentions. Well, that’s OAuth 2.0.

Last month I reached the painful conclusion that I can no longer be associated with the OAuth 2.0 standard. I resigned my role as lead author and editor, withdraw my name from the specification, and left the working group. Removing my name from a document I have painstakingly labored over for three years and over two dozen drafts was not easy. Deciding to move on from an effort I have led for over five years was agonizing.

There wasn’t a single problem or incident I can point to in order to explain such an extreme move. This is a case of death by a thousand cuts, and as the work was winding down, I’ve found myself reflecting more and more on what we actually accomplished. At the end, I reached the conclusion that OAuth 2.0 is a bad

@afucher
afucher / consoleDir.cs
Created January 19, 2021 23:05
[dotnet] Imprime propriedades e valores de um objeto
foreach(PropertyDescriptor descriptor in TypeDescriptor.GetProperties(obj))
{
string name=descriptor.Name;
object value=descriptor.GetValue(obj);
Console.WriteLine("{0}={1}",name,value);
}
@Gutek
Gutek / C# Version Cheat Sheet.md
Last active February 8, 2022 09:33
Short cheat sheet of changes in C# language from version 6 to 9

CS 6

read-only auto properties

Small help with immutable types...

// private readonly int _age;
// public int Age { get { return _age; } }
public int Age { get; }
@lucasteles
lucasteles / how-to.ps1
Last active May 2, 2020 12:02
Rename all file names and replace all files content
# copy the replace-everything.ps1 to the folder
# run
.\replace-everything.ps1 -Folder . -FilePattern *.cs -TextToChange "from" -NewText "To"
@lucasteles
lucasteles / ResultSample.cs
Last active August 16, 2022 11:54
Result<TOk,TError> C# Sample
using System;
#region 'Implementaçao exemplo do result'
public static class Result {
public static Result<TSuccess,TFailure> Ok<TSuccess, TFailure>(TSuccess value) => new OkResult<TSuccess, TFailure>(value);
public static Result<TSuccess,TFailure> Error<TSuccess, TFailure>(TFailure value) => new ErrorResult<TSuccess, TFailure>(value);
}
public abstract class Result<TOk, TError> {
@VincentH-Net
VincentH-Net / RegistrationCodePage.cs
Last active April 4, 2022 18:47
C# language proposal examples for UI markup #CSharpForMarkup
// C# vNext markup friendly
enum Row { Icon, Prompt, Header, Entry }
void Build() => Content = new Grid
{
RowDefinitions = Rows.Define(
(Icon , Auto),
(Prompt, Auto),
(Header, 50 ),
(Entry , Auto)
@csuzw
csuzw / index.js
Created November 7, 2019 10:49
Azure AD Single Sign On with Cypress
// This goes in cypress/plugins/index.js
const AzureAdSingleSignOn = require('./azure-ad-sso/plugin').AzureAdSingleSignOn
module.exports = (on, config) => {
on('task', {AzureAdSingleSignOn:AzureAdSingleSignOn})
}