Skip to content

Instantly share code, notes, and snippets.

View noseratio's full-sized avatar

Andrew Nosenko noseratio

View GitHub Profile
@SimonCropp
SimonCropp / Enabling_OSS_sustainability.md
Last active January 3, 2021 18:51
Enabling OSS sustainability

Add "requesting sponsorship" to package metadata

Package formats (nuget, npm etc) should be amended to add the concept of "this package is requesting sponsorship via ...". The "via..." part could be influence by the GitHub Funding.yml convention.

Surface "requesting sponsorship" in tooling

Once "requesting sponsorship" metadata is added, tooling can expose this in a variety of ways. For example:

const streamWithContext = (context, stream) => ({
async next(value) {
return Promise.race([context.cancelled, stream.next(await value)]);
},
async return(value) {
return Promise.race([context.cancelled, stream.return(await value)]);
},
async throw(error) {
return Promise.race([context.cancelled, stream.throw(await error)]);
},
@richlander
richlander / modernizing-csharp9.md
Last active April 26, 2024 17:14
Modernizing a codebase for C# 9

Modernizing a codebase for C# 9

There are lots of cases that you can improve. The examples use nullable reference types, but only the WhenNotNull example requires it.

Use the property pattern to replace IsNullorEmpty

Consider adopting the new property pattern, wherever you use IsNullOrEmpty.

string? hello = "hello world";

What Hiring Should Look Like

This is definitely not the first time I've written about this topic, but I haven't written formally about it in quite awhile. So I want to revisit why I think technical-position interviewing is so poorly designed, and lay out what I think would be a better process.

I'm just one guy, with a bunch of strong opinions and a bunch of flaws. So take these suggestions with a grain of salt. I'm sure there's a lot of talented, passionate folks with other thoughts, and some are probably a lot more interesting and useful than my own.

But at the same time, I hope you'll set aside the assumptions and status quo of how interviewing is always done. Just because you were hired a certain way, and even if you liked it, doesn't mean that it's a good interview process to repeat.

If you're happy with the way technical interviewing currently works at your company, fine. Just stop, don't read any further. I'm not going to spend any effort trying to convince you otherwise.

@oofnikj
oofnikj / gen-efi-image.sh
Last active October 22, 2023 13:26
Generate OpenWrt 19.07.2 EFI-compatible image
#!/usr/bin/env bash
### UPDATED SCRIPT AVAILABLE AT https://github.com/oofnikj/openwrt-efi-tools ###
# gen-efi-image.sh [DEST_IMG] [EFI_IMG] [SOURCE_IMG]
#
# Generates an EFI-compatible x86-64 disk image for OpenWrt
# by combining the rootfs and kernel from the latest stable release
# with the EFI image available in snapshot since @a6b7c3e.
#
@nightuser
nightuser / use_existing_session.patch
Last active April 26, 2024 13:22
Use existing Xorg session for chrome-remote-desktop
Add an option to use the existing Xorg session with
chrome-remote-desktop.
The original idea of the patch: https://superuser.com/a/850359
--- a/chrome-remote-desktop 2024-03-27 16:03:20.518579015 +0000
+++ b/chrome-remote-desktop 2024-03-27 16:17:58.241912847 +0000
@@ -110,6 +110,8 @@
X_LOCK_FILE_TEMPLATE = "/tmp/.X%d-lock"
FIRST_X_DISPLAY_NUMBER = 20
@SteveSandersonMS
SteveSandersonMS / Index.razor
Created February 20, 2020 14:24
Blazor WebAssembly use of ClientWebSocket
@page "/"
@using System.Net.WebSockets
@using System.Text
@using System.Threading
@implements IDisposable
<h1>Echo test</h1>
<h3>State: @webSocket.State</h3>
@if (webSocket.State == WebSocketState.Open)
@eviltester
eviltester / gist:11093f0e4c501a41990e227393184eda
Last active April 24, 2024 11:35
uncheck twitter interests
var timer=100;document.querySelectorAll("div > input[type='checkbox']:checked").forEach((interest) => {setTimeout(function(){interest.click()},timer);timer+=2000;});
@davidwhitney
davidwhitney / setup.ps1
Last active April 10, 2024 10:54
Machine setup chocolatey script
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco feature enable -n allowGlobalConfirmation
choco install notepad2
choco install notepadplusplus
choco install 7zip
choco install paint.net
choco install autoruns
choco install vcredist140
choco install dotnetfx
public async Task KillProcessNicely(uint pid, int delayInMs = 3*1000)
{
// Ugh, this is gross - https://stackoverflow.com/questions/16653517/how-best-to-post-wm-quit-to-a-running-process
var tids = NativeMethods.GetAllTopLevelWindowsInZOrder()
.Select(hwnd => {
uint wndpid = 0;
var tid = NativeMethods.GetWindowThreadProcessId(hwnd, out wndpid);
if (wndpid != pid) {
return (uint)0;
}