Skip to content

Instantly share code, notes, and snippets.

View chrisfcarroll's full-sized avatar
🤹‍♂️
🌍...☕...🖥️...⏳...⛪...🛌🏼

Chris F Carroll chrisfcarroll

🤹‍♂️
🌍...☕...🖥️...⏳...⛪...🛌🏼
View GitHub Profile
@jboner
jboner / latency.txt
Last active April 25, 2024 01:18
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@paulirish
paulirish / what-forces-layout.md
Last active April 24, 2024 12:47
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@chrisfcarroll
chrisfcarroll / Microsoft.PowerShell_profile.ps1
Last active March 28, 2024 14:57
Common Aliases and Paths for PowerShell Profile Microsoft.PowerShell_profile.ps1
# https://gist.github.com/chrisfcarroll/f3ecb2892f996149ee039d48abb57101
# Aliases and Paths for PowerShell Profile ~\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
#
# -----------------------------------------------------
# For machines where you have no privileges you should be able to enable scripts for yourself only with:
#
# `Set-ExecutionPolicy RemoteSigned -Scope CurrentUser`
# -----------------------------------------------------
#
# Sections: Paths, Editors, Tab Completion, Git abbreviations, Docker abbreviations, other prefs, firstRun
@jkatz
jkatz / encrypt_password.py
Last active March 26, 2024 16:37
Methods to create password verifiers for PostgreSQL
# Copyright 2019-2022 Jonathan S. Katz
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@necojackarc
necojackarc / Mac Settings.md
Last active February 20, 2024 10:46
Mac Settings

General

  • Show the battery percentage (System Settings > Control Centre > Battery)
  • Show all filename extensions on Finder (Finder > Settings > Advanced)
  • Show Path Bar on Finder (Finder > View)
  • Install KeePassXC to manage credentials
  • Install Google Drive to sync important files such as KeePass file
  • Install Google Chrome
  • Install AlDente to limit maximum charging percentage
  • Show App Switcher (cmd+TAB) on all displays
  • defaults write com.apple.Dock appswitcher-all-displays -bool true
# This is Git's per-user configuration file.
# [user]
[alias]
root = rev-parse --show-toplevel
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
[merge]
tool = p4merge
[color]
ui = true
[color "status"]
@chrisfcarroll
chrisfcarroll / EFCoreAndDomainModels.cs
Last active November 7, 2023 12:39
Minimal EFCore Demo for Domain-Application-Infrastructure DDD structure
using System.Diagnostics;
using EFCoreAndDomainModels.Application;
using EFCoreAndDomainModels.Domain;
using EFCoreAndDomainModels.Infrastructure;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using TestBase;
using Xunit.Abstractions;
namespace EFCoreAndDomainModels
@iharosi
iharosi / useful-osx-commands.md
Last active September 21, 2023 07:25
Useful OS X commands

###Useful OS X commands

  1. App Store Debug menu

    Show

    defaults write com.apple.appstore ShowDebugMenu -bool true
    

    Hide

@gertjvr
gertjvr / CorrelationExample.cs
Last active October 14, 2022 14:28
MT3 + Serilog CorrelationId Enricher.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Remoting.Messaging;
using System.Threading.Tasks;
using MassTransit;
using MassTransit.Configurators;
using MassTransit.PipeBuilders;
using MassTransit.PipeConfigurators;
using MassTransit.Pipeline;