Skip to content

Instantly share code, notes, and snippets.

View GuyInGrey's full-sized avatar
👌
Enjoying Life

GuyInGrey GuyInGrey

👌
Enjoying Life
  • United States
View GitHub Profile
@GuyInGrey
GuyInGrey / Program.cs
Last active June 4, 2023 03:39
SynacorSharp
using SynacorSharp.Runtime;
namespace SynacorSharp.ConsoleApp
{
internal class Program
{
static void Main()
{
var engine = new SynacorEngine()
{
using System.Collections.Generic;
using System.Threading.Tasks;
using DSharpPlus.Entities;
using DSharpPlus.SlashCommands;
using DSharpPlus;
using DSharpPlus.EventArgs;
using System.Linq;
using Newtonsoft.Json.Linq;
using System;
var props = new SlashCommandCreationProperties()
{
Name = "elite",
Description = "Commands related to Elite: Dangerous.",
Options = new List<ApplicationCommandOptionProperties>()
{
new ApplicationCommandOptionProperties()
{
Name = "status",
Description = "Get Elite's server status.",
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Net;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using System.Windows.Forms;
using Flurl;
using Newtonsoft.Json;
using System;
using SixLabors.ImageSharp;
using SixLaborsRgba32 = SixLabors.ImageSharp.PixelFormats.Rgba32;
namespace MandelbrotCPUTest
{
class Program
{
static void Main()
using System;
using System.Numerics;
using SixLabors.ImageSharp;
using SixLaborsRgba32 = SixLabors.ImageSharp.PixelFormats.Rgba32;
namespace MandelbrotCPUTest
{
class Program
{
public readonly struct MandelbrotShader : IComputeShader
{
public readonly ReadWriteTexture2D<Rgba32, Float4> image;
public readonly Float4 viewport;
public readonly int maxIterations;
public readonly float power;
public MandelbrotShader(
ReadWriteTexture2D<Rgba32, Float4> image,
Float4 viewport,
using System.Drawing;
using ComputeSharp;
using Windows.Devices.SmartCards;
namespace EDStatistics_Core
{
public readonly struct HeatmapImageGenerationShader : IComputeShader
{
public readonly ReadWriteBuffer<int> density;
public readonly ReadWriteBuffer<int> image;
[Command("mandelbrot")]
public async Task Mandelbrot()
{
var maxToRun = 40;
var frames = 3600;
var path = @"C:\RenderingTemp\";
var colors = Enumerable.Range(0, maxToRun + 1).Select(i => Paint.Lerp(Paint.White, Paint.Black, i / (float)maxToRun)).ToArray();
if (Directory.Exists(path)) { try { Directory.Delete(path, true); } catch { } }
Directory.CreateDirectory(path);
Client.ChannelCreated += async (a) => DiscordEvent("ChannelCreated", a);
Client.ChannelDestroyed += async (a) => DiscordEvent("ChannelDestroyed", a);
Client.ChannelUpdated += async (a, b) => DiscordEvent("ChannelUpdated", a, b);
Client.Connected += async () => DiscordEvent("Connected");
Client.CurrentUserUpdated += async (a, b) => DiscordEvent("CurrentUserUpdated", a, b);
Client.Disconnected += async (a) => DiscordEvent("Disconnected", a);
Client.GuildAvailable += async (a) => DiscordEvent("GuildAvailable", a);
Client.GuildMembersDownloaded += async (a) => DiscordEvent("GuildMembersDownloaded", a);
Client.GuildMemberUpdated += async (a, b) => DiscordEvent("GuildMembersUpdated", a, b);
Client.GuildUnavailable += async (a) => DiscordEvent("GuildUnavailable", a);