Skip to content

Instantly share code, notes, and snippets.

View khalidabuhakmeh's full-sized avatar
👨‍⚖️
talking & listening to developers

Khalid Abuhakmeh khalidabuhakmeh

👨‍⚖️
talking & listening to developers
View GitHub Profile
public static class PropertyNameDataCollector
{
public static async Task Scan(this Assembly assembly, string outputFilePath, bool includeHeader = true)
{
var properties = assembly
.GetTypes()
.SelectMany(x => x.GetProperties())
// only want BCL types
.Where(x => x.PropertyType.Namespace != null && x.PropertyType.Namespace.StartsWith("System"))
.Select(x => new
using System;
using System.Collections.Generic;
using System.Linq;
public static class Program
{
public const int TotalTips = 61;
private static void Main()
{
const int year = 2020;
version: '3.4'
services:
neo4j:
image: "neo4j"
container_name: "neo4j"
ports:
- 7474:7474
- 7687:7687
restart: always
@khalidabuhakmeh
khalidabuhakmeh / questions.md
Created April 3, 2020 18:50
Profile Questions

Profile Questions

Please include a photo of yourself. Feel free to include photos of your keyboard, monitor, office setup.

Introduction

In a paragraph introduce yourself. Who are you? What's your current job title? What kinds of projects are you currently working on in what field?

  • What's Your Daily Technology Stack / Tools / Hardware?
  • What do you want to do more of? What's keeping you from doing it?
@khalidabuhakmeh
khalidabuhakmeh / macos_to_windows.md
Created November 12, 2019 21:06
macOS to Windows Apps
macOS Windows
VS Code VS Code
Annotate [Snagit][snagit] or [Captura][captura]
Alfred [Jarvis][jarvis] or [Cerebro][cerebro]
JetBrains Rider JetBrains Rider or Visual Studio 2019
Pixelmator Pro [Affinity][affinity]
Clocks Windows Multiple Clocks
OhMyZsh OhMyZsh (WSL2)
iTerm2 [ConEmu][conemu] or [Terminal][terminal]
@khalidabuhakmeh
khalidabuhakmeh / iot_microsoft_graph_meetings.md
Last active August 7, 2019 17:11
Microsoft Graph IoT Room Meeting Display

We currently use Joan devices to display upcoming meetings in rooms. It works OK, but they have drawbacks.

  1. They are very expensive. Each device ranges between $500 to $899.
  2. To get more features, you have to subscribe to a service for each device.
  3. The wall mounts are a ridiculous $150 a piece. We have 16, which would mean we spend $2,400 on wall mounts alone!

Idea

Use the Microsoft Graph to determine the meeting schedule of each room and the attendees in our building. I want to build a Raspberry Pi attached to an E-Ink display that will display that information.

@khalidabuhakmeh
khalidabuhakmeh / multiple_results_with_parameters.cs
Created March 12, 2019 13:14
EF MultipleResults with SqlParameters
public static class MultipleResultSets
{
public static MultipleResultSetWrapper MultipleResults(
this DbContext db,
string storedProcedure,
params SqlParameter[] parameters
)
{
return new MultipleResultSetWrapper(db, storedProcedure, parameters);
}
@khalidabuhakmeh
khalidabuhakmeh / tweaks.cs
Created January 1, 2019 17:08
Carter Tweaks
// ctx is a CarterContext<T> where T is UpdateActor
// this allows the context to run binding and validation
// ctx also has property accessors for Request, Response, and other helpers.
this.Put<UpdateActor>("/actors/{id:int}", async (ctx) =>
{
// validation is called once and results are cached for request
if (!ctx.IsValid)
{
ctx.Response.StatusCode = 422;
await res.Negotiate(ctx.GetFormattedErrors());
@khalidabuhakmeh
khalidabuhakmeh / azureapi.md
Created December 22, 2018 15:00
Azure API Management Questions

Azure API Management Questions

App Assumption

We are building an ASP.NET Core API. We would like our API to have the following advantages:

  • Infrastructure
  • Caching (Server and Client Side)
  • Scaling / Performance
  • Security
@khalidabuhakmeh
khalidabuhakmeh / profiler_workshop.md
Created December 3, 2018 18:25
Profiler Workshop

Profiling Workshop

I would imagine a Profiling Workshop, specifically around DotTrace and DotMemory would cover the following topics in the following order:

Introduction

When building a performant .NET Application, what parts of your application contribute to the overall experience.

  1. Explain Garbage Collection
  2. CPU utilization