This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type { Plugin } from 'vite' | |
import path from 'path' | |
const name = 'prevent-server-data-circular-imports' | |
const defaultOptions = { verbose: false } | |
// Detect if the module is in server-data | |
const serverDataFileRegexp = /(.*)?server-data\/src\// | |
// Extract the imported path |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Runtime.CompilerServices; | |
using static ParsingExtensions; | |
string input = "Name: Andrew; Age: 31"; | |
string? name = null; | |
int age = 0; | |
if (input.TryParse($"Name: {Placeholder(ref name)}; Age: {Placeholder(ref age)}")) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
namespace Sylvan | |
{ | |
public sealed class IgnoreWhitespaceStringComparer : IEqualityComparer<string> | |
{ | |
public static readonly IEqualityComparer<string> Instance = new IgnoreWhitespaceStringComparer(0); | |
public static readonly IEqualityComparer<string> IgnoreCase = new IgnoreWhitespaceStringComparer(0x20); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Buffers; | |
using System.Net.WebSockets; | |
var builder = WebApplication.CreateBuilder(args); | |
var app = builder.Build(); | |
app.MapGet("/ws", async (HttpContext context) => | |
{ | |
const int MaxMessageSize = 1024 * 1024; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install-Module NtObjectManager | |
Import-Module NtObjectManager | |
$Servers = Get-RpcServer -Path C:\Windows\system32\efssvc.dll ` | |
-DbgHelpPath 'C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\dbghelp.dll' | |
$EfsInterace = $Servers | Where-Object { $_.InterfaceId -eq 'df1941c5-fe89-4e79-bf10-463657acf44d' } | |
$client = Get-RpcClient -Server $EfsInterace | |
$client.Connect() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Running; | |
using System; | |
namespace RecordStructBM { | |
class Program { | |
static void Main(string[] args) { | |
BenchmarkRunner.Run<BM>(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Estimating CPU frequency... | |
// CPU frequency: 4.52 GHz | |
// sum1: value = 15182118497126522709, 0.31 secs, 5.14 cycles/elem | |
// sum2: value = 15182118497126522709, 0.17 secs, 2.93 cycles/elem | |
#define RW(x) asm("" : "+r"(x)) | |
typedef struct Node { | |
u64 value; | |
struct Node *next; |