Skip to content

Instantly share code, notes, and snippets.

View DarkStoorM's full-sized avatar

Bartosz Sieprawski DarkStoorM

View GitHub Profile
@DarkStoorM
DarkStoorM / Subject-Oriented Inpainting.md
Created August 3, 2023 22:28
Random document on Subject-Oriented Inpainting and Detailing in Stable Diffusion + my personal workflow.

Settings

Model: any 1.5 base (no difference on 2.1 anyway, just the embeddings don't work, that would require changing the prompt)

Size: 512x512, Steps: 100, CFG scale: 7, Seed: 2583996050

Prompt

@DarkStoorM
DarkStoorM / twitch_skip_redemption_window.md
Last active May 9, 2024 18:44
Twitch spam redemptions

Spam channel points rewards by skipping the redemption window without Twitch API

  • open Devtools -> Network
  • filter requests by gql.twitch

a

  • clear requests list and redeem a channel points reward
  • right click the request and copy as fetch

Convert VSCode theme to Visual Studio 2022

You have probably stumbled upon this video, which explains how to convert your favorite VSCode theme to also be usable in Visual Studio 2022. Well, it's not entirely correct, it still applies, but there has to be some clarification.

As the video lacks some information, I will try to make it as easy as possible.

Table of Contents:

TypeScript - infer type of second argument based on the first argument inside classes

class Selector<Interface> {
  public where<Key extends keyof Interface>(
    key: keyof Pick<Interface, Key>,
    value: Interface[Key]
  ) {
    // [implementation]
  }
@DarkStoorM
DarkStoorM / mixins.ts
Last active October 31, 2021 20:45
TypeScript Inject Mixins from multiple classes
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/**
* Applies the implementation of baseConstructors to the derived constructor - injects methods into
* the given class.
*
* @param {{ new (): T }} derivedConstructor Class we want to inject mixins into
* @param {{ new (): unknown }[]} baseConstructors Array of classes we want to take mixins from
*/
export function ApplyMixins<T>(
@DarkStoorM
DarkStoorM / laravel-route-separation.md
Last active June 27, 2021 13:48
Laravel Route Separation experiment

Laravel Route Separation

After poking around with route separation, I found this (a bit messy and ugly) way to keep routes in separate files without touching the RouteServiceProvider at all - the only update is to change the web namespace to 'routes/web/main.php' since this will be the definitions file for all routes.

This is more of an experiment, not a recommended way of doing this. You could also do this in RouteServiceProvider in a loop with glob.

First thing to do will be moving routes to a new directory: routes/web, which will only contain main.php and index.php files - main being the definitions file which will register route groups all together .

Let's assume we have a website, where we can edit our profile and change some private account settings. The structure would be something like the example below (not ideally of course, it's just a quick example, no one would structure a page like this):

@DarkStoorM
DarkStoorM / DictionaryExtensions.cs
Created May 16, 2021 23:03
[C#] Merge two Dictionaries together
using System.Collections.Generic;
using System.Linq;
public static class DictionaryExtensions
{
/// <summary>
/// <para />Merges this dictionary with another dictionary
/// <example>
/// <code>
/// Dictionary&lt;string, int&gt; dictionary = dictionary.MergeWith(otherDictionary);

Disclaimer

This is not a Documentation format. This is a very close transcription of Academind's video: "TypeScript Course for Beginners 2021 - Learn TypeScript from Scratch!", which was a part of my learning process. I highly recommend watching the entire 3 hours course available on Academind's YouTube channel.

This is not a 1:1 transcription (roughly 90:100) - do not rely on these notes as some parts of the video were skipped and it contains some self-interpreted content.

GitHub anchors might not work, sadly ¯_(ツ)_/¯