

public enum BookCategories | |
{ | |
[Description("Options")] | |
[Display(Name = "Select")] | |
Select = 0, | |
[Description("Space Travel")] | |
[Display(Name = "Space Travel")] | |
SpaceTravel = 1, | |
[Description("Adventure")] | |
[Display(Name = "Adventure")] |
/// <summary> | |
/// Custom setting for presenting runtime exceptions using AnsiConsole.WriteException. | |
/// | |
/// The idea here is to present different types of exceptions with different colors while | |
/// one would be for all exceptions and the other(s) for specific exception types. | |
/// </summary> | |
public class ExceptionHelpers | |
{ | |
/// <summary> | |
/// Provides colorful exception messages in cyan and fuchsia |
// This script will iterate over all of your ChatGPT sessions and archive them one-by-one. | |
// | |
// 1. Go to https://chat.openai.com/ | |
// 2. Open Chrome devtools (see https://developer.chrome.com/docs/devtools/open) or equivalent in your browser | |
// 3. Open the console tab | |
// 4. Paste the code below and press enter | |
const pause = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); | |
const history = document.querySelector('[aria-label="Chat history"]'); | |
while (true) { |
public class Result | |
{ | |
protected internal Result(bool isSuccess, Error error) | |
{ | |
if (isSuccess && error != Error.None) | |
{ | |
throw new InvalidOperationException(); | |
} | |
if (!isSuccess && error == Error.None) |
Example of Kamal deployment from Github Actions.
Add your applications .env
variables to the Github repo as a repository secret, you can find this under the repo settings => secrets and variables => actions
https://github.com/username/repo_name/settings/secrets/actions
you are going to need an ssh private key that your deployment server is aware of (add public key to servers .ssh/authorized_keys) and add the ssh private key as a repo secret
create action workflows
<PropertyGroup> | |
<PathMap>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)'))=./</PathMap> | |
</PropertyGroup> |
root = true | |
# C# files | |
[*.cs] | |
#### Core EditorConfig Options #### | |
# Indentation and spacing | |
indent_size = 4 | |
indent_style = space |
using System.Data.Common; | |
using System.Runtime.CompilerServices; | |
using System.Text; | |
using Npgsql; | |
GetCatalogItemsSql(null, null, null, 10); | |
void GetCatalogItemsSql(int? catalogBrandId, int? before, int? after, int pageSize) | |
{ | |
// This looks like it would be susceptible to SQL injection, but it's not. |
I want you to become my Prompt Creator. | |
Your goal is to help me craft the best possible prompt for my needs. | |
The prompt will be used by you, ChatGPT. | |
You will follow the following process: | |
1. |