Skip to content

Instantly share code, notes, and snippets.

View ProbablePrime's full-sized avatar
😍
Making memes

ProbablePrime ProbablePrime

😍
Making memes
View GitHub Profile
const { mwn } = require('mwn');
function shouldIgnore(title) {
if (title === "Category:ProtoFlux")
return true;
if (title === "Category:ProtoFlux:All")
return true;
if (title === "Category:ProtoFluxStubs")
return true;
@ProbablePrime
ProbablePrime / Program.cs
Last active April 11, 2023 07:07
A ReactiveUI question about summing properties from a collection based on a filter.
using DynamicData;
using DynamicData.Binding;
using ReactiveUI;
using ReactiveUI.Fody.Helpers;
using System.Collections.ObjectModel;
using System.Diagnostics;
namespace ConsoleApp1;
/** Simplified for this question, but let's say I'm building a UI with this layout
* | Name | Should be Included| Size |
@ProbablePrime
ProbablePrime / CSharpJSONQuoteHandling.cs
Created October 15, 2021 07:05
C#'s System.Text.Json has weird handling for quotes. This makes it behave more like Newtonsoft.
using System;
using System.Text.Encodings.Web;
using System.Text.Json;
namespace JSONStuff
{
class Program
{
static void Main(string[] args)
{
<html>
<head>
<style type="text/css">
.malm {
height: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
@ProbablePrime
ProbablePrime / user_setup_ubuntu.md
Last active August 13, 2017 20:06
Provisioning a new user on an Ubuntu Machine manually.

While experimenting with Ubuntu on a variet of systems I often need to stand up a brand new machine and secure access to it. A lot of providers will setup the machine using the root account and email you a password. I'd rather not use the root user and setup RSA Keys. Doing this manually is a bit of a chore but if you don't have any other options here's how to do it.

1 Create User

  1. Use adduser to do this quickly.
  2. Run adduser <username>.
  3. Enter a new password twice, Remember this needed for sudo.

2 Create User SSH Config

This is the section i always forget, I'll usually spend half an hour googling for the chmod settings required.

@ProbablePrime
ProbablePrime / notes.md
Last active September 15, 2022 00:02
Elgato Stream Deck Notes

Notes

Button Map

Streamdeck uses Hex HID values to map to its buttons. Their Hex values range from 01 - 0F.

Filters

Capture software adds junk to the copied output of bytes this regex can remove it in vscode: .{8} (.*) .* $

import fetch , { Request, Response, RequestInit } from 'node-fetch'; //tslint:disable-line
const fetchCookie: (url: string | Request, init?: RequestInit) => Promise<Response> = require('fetch-cookie')(fetch); //tslint:disable-line
const BASE = 'https://beam.pro/api/v1/';
function buildURL(url: string): string {
return BASE + url;
}

Chat Poll Changelog

  • It is now valid to create polls without a duration and which must be manually halted. However after 30 days these polls will expire automatically.

  • The PollStart event is deprecated in favor of PollProgress.

  • A PollProgress event is formatted like so:

    {
/**
* Attempt to use OAuth to authenticate with beam.
* It is assumed that you are using an IMPLICIT flow here.
*
* @param {Object} config A config object
* @param {String} config.token The implicit OAuth token for this user
* @param {BeamClient} beam A beam client instance
* @returns {Promise.<user>}
*/
function oAuth(config, beam) {

Keybase proof

I hereby claim:

  • I am ProbablePrime on github.
  • I am probableprime (https://keybase.io/probableprime) on keybase.
  • I have a public key whose fingerprint is 7173 39BB D6D9 04D0 027C 7E29 83CD 1B43 231A A685

To claim this, I am signing this object: