Skip to content

Instantly share code, notes, and snippets.

View tompazourek's full-sized avatar
👨‍💻
Busy

Tom Pažourek tompazourek

👨‍💻
Busy
View GitHub Profile
@tompazourek
tompazourek / settings.json
Last active November 17, 2022 09:14
Windows Terminal's settings.json
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command": "find",
"keys": "ctrl+shift+f"
},
{
@tompazourek
tompazourek / Sample.cs
Last active September 21, 2021 16:21
Simple service locator implementation. Runs on .NET 3.5 and also on .NET Compact Framework. The implementation should be thread-safe.
ServiceLocator.RegisterSingleton<ISomeClass>(() => new SomeClass(x, y, z));
ServiceLocator.Register<IOtherClass>(() => new OtherClass(x, y, z));
ServiceLocator.GetInstance<IOtherClass>(); // returns registered instance or fails
IOtherClass instance;
if (ServiceLocator.TryGetInstance<IOtherClass>(out instance)) { // if there is a registered instance
// ...
}
@tompazourek
tompazourek / settings.json
Last active July 26, 2021 09:21
VSCode settings.json
{
"workbench.iconTheme": "vscode-icons",
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"terminal.integrated.shellArgs.windows": [
"-NoLogo"
],
"workbench.colorTheme": "Visual Studio Light",
"[powershell]": {
"editor.defaultFormatter": "ms-vscode.powershell"
},
<!DOCTYPE html>
<meta charset=utf-8>
<meta name=viewport content="width=device-width,initial-scale=1">
<style>
body{
font:menu;font-size:1.125em;
margin:auto;max-width:40em;
padding:0 0.5em 90vh 0.5em;
}
</style>
@tompazourek
tompazourek / ConsoleApp1.csproj
Last active January 1, 2021 13:08
Colourful convert from xy chromaticity to RGB (sRGB)
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Colourful" Version="3.0.0-beta1" />
</ItemGroup>
@tompazourek
tompazourek / CustomTheme.psm1
Last active September 12, 2020 21:24
PS profile
#requires -Version 2 -Modules posh-git
function Write-Theme {
param(
[bool]
$lastCommandFailed,
[string]
$with
)
@tompazourek
tompazourek / keybindings.json
Created June 3, 2020 21:11
VSCode keybindings.json
// Place your key bindings in this file to override the defaults
[
{
"key": "alt+t",
"command": "workbench.action.terminal.sendSequence",
"args": {
"text": "cd '${fileDirname}'\u000D"
}
}
]
{
"name": "Light (Visual Studio)",
"globals": {
"background": "#FFFFFF",
"foreground": "#000000",
"gutter_foreground": "#2B91AF",
"selection": "#99C9EF",
"selection_border": "#CCE4F7",
"selection_border_width": "2",
"inactive_selection": "#E5EBF1",
{
"color_scheme": "Packages/User/light_vs.sublime-color-scheme",
"font_size": 10,
"line_padding_bottom": 1,
"line_padding_top": 0,
"ignored_packages": [
"Vintage"
],
"mini_diff": "auto",
"show_encoding": true,
@tompazourek
tompazourek / commit-config.sh
Last active April 15, 2020 13:59 — forked from tqheel/commit-config.sh
Prevent ASP.Net Web.Config From Being Committed By Git
#Run this to reverse ignoring of changes to web.config so it gets committed.
git update-index --no-assume-unchanged path_to_file/web.config