Skip to content

Instantly share code, notes, and snippets.

@AtomicBlom
AtomicBlom / third_person_camera.json
Created July 4, 2019 06:48
Third Person Camera from Bedrock 1.13 beta
{
"field_of_view": 66.0,
"near_clipping_plane": 0.025,
"far_clipping_plane": 2500.0,
"render_player_model": true,
"priority": 1,
"player_rotation_offset": [0.0, 180.0],
"blend_in_default": {
"blend_time": 0.0,
"ease": "in_out_cubic",
@AtomicBlom
AtomicBlom / Backup SQL Diagrams.cs
Created November 19, 2018 02:08
Create a SQL script that will restore your diagrams created in SSMS.
//Specify a filename location if you want to save the file.
string filename = null;
//Set this to a DbSet, DbTable or whatever you are using to access [dbo].[SysDiagrams] for your database.
var sysDiagramsSource = Sysdiagrams;
var diagramDefinition = from diagram in sysDiagramsSource
select new
{
Name = diagram.Name,
diagram.Principal_id,
@AtomicBlom
AtomicBlom / program.cs
Created October 11, 2018 08:52
A simple REPL loop for Brigadier.NET
using System;
using System.Threading.Tasks;
using Brigadier.NET;
using Brigadier.NET.Builder;
using Brigadier.NET.Exceptions;
using static Brigadier.NET.Arguments;
namespace TestBrigadier
{
class Program
@AtomicBlom
AtomicBlom / pixelate.shader
Created October 9, 2018 14:29
Pixelate effect for OBS Study (obs-shaderfilter plugin)
//-----------------------------------------------------------------------------------------
// Shader constant register mappings (scalars - float, double, Point, Color, Point3D, etc.)
//-----------------------------------------------------------------------------------------
uniform float horizontal_pixel_counts;
uniform float vertical_pixel_counts;
uniform float speed;
//--------------------------------------------------------------------------------------
// Sampler Inputs (Brushes, including ImplicitInput)
@AtomicBlom
AtomicBlom / RxEventAggregatorMessagingAdapter.cs
Created October 30, 2017 05:53
Reactive.EventAggregator adapter for Template10
using System;
using System.Collections.Generic;
using System.Linq;
using Reactive.EventAggregator;
using Template10.Services.Messenger;
namespace Sample.Framework.Messaging.RxEventAggregator
{
public class RxEventAggregatorMessagingAdapter : IMessengerAdapter
{
@AtomicBlom
AtomicBlom / AutofacContainerAdapter.cs
Last active February 19, 2018 18:40
Template10AutofacIntegration
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using Autofac;
using Template10.Services.Dependency;
namespace Sample.Framework.Dependency.Autofac
{
//Current implementation of Template10 assumes that registrations can be added ad-hoc.
@AtomicBlom
AtomicBlom / MinecraftChatWatcher.ps1
Created July 17, 2017 11:31
Minecraft Server Chat Parser
if ($args.Length -eq 0) {
Write-Error "Please provide a filename at the command line"
exit
}
$file = $args[0]
if (-not (Test-Path $file)) {
Write-Error "File not found: $file"
exit
}
> /chunkCauses start
[13:24:52] [Server thread/INFO] [chunkwatcher]: [tick 181813573] [0]: Chunk Loaded @ [-17, 11] in 3, loaded 4468 times in 30 minutes (68 tile entities)
[13:24:52] [Server thread/INFO] [chunkwatcher]: [tick 181813573] [1]: Chunk Loaded @ [-17, 12] in 3, loaded 8185 times in 30 minutes (201 tile entities)
[13:24:52] [Server thread/INFO] [chunkwatcher]: [tick 181813573] [0]: Chunk Loaded @ [-17, 13] in 3, loaded 8195 times in 30 minutes (70 tile entities)
[13:24:52] [Server thread/INFO] [chunkwatcher]: [tick 181813573] [0]: Chunk Loaded @ [-16, 13] in 3, loaded 2836 times in 30 minutes (92 tile entities)
[13:24:52] [Server thread/INFO] [chunkwatcher]: [tick 181813573] [0]: Chunk Loaded @ [-15, 13] in 3, loaded 2835 times in 30 minutes (30 tile entities)
[13:24:52] [Server thread/INFO] [chunkwatcher]: [tick 181813573] [2]: Chunk Loaded @ [-16, 14] in 3, loaded 2836 times in 30 minutes (19 tile entities)
[13:24:52] [Server thread/INFO] [chunkwatcher]: [tick 181813573] [3]: Chunk Loaded @ [-16,
> /chunkCauses start
[12:10:19] [Server thread/INFO] [chunkwatcher]: [tick 181738482] [0]: Chunk Loaded @ [-15, 13] in 3, loaded 44 times in 30 minutes (30 tile entities)
[12:10:19] [Server thread/INFO] [chunkwatcher]: [tick 181738482] [0]: Chunk Loaded @ [-17, 13] in 3, loaded 89 times in 30 minutes (70 tile entities)
[12:10:19] [Server thread/INFO] [chunkwatcher]: [tick 181738482] [1]: Chunk Loaded @ [-17, 12] in 3, loaded 85 times in 30 minutes (201 tile entities)
[12:10:19] [Server thread/INFO] [chunkwatcher]: [tick 181738482] [2]: Chunk Loaded @ [-17, 11] in 3, loaded 73 times in 30 minutes (68 tile entities)
[12:10:19] [Server thread/INFO] [chunkwatcher]: [tick 181738483] [0]: Chunk Loaded @ [-16, 13] in 3, loaded 45 times in 30 minutes (92 tile entities)
[12:10:19] [Server thread/INFO] [chunkwatcher]: [tick 181738484]: Chunk Unloading @ [-15, 13] in 3 (30 tile entities)
[12:10:19] [Server thread/INFO] [chunkwatcher]: [tick 181738484]: Chunk Unloading @ [-17, 11] in 3 (68 tile entities)
[12:10:19] [Serv
@AtomicBlom
AtomicBlom / gist:8e9c31ac675a61876e4bc7809e238beb
Created August 30, 2016 22:07
Simplified use case for the BabyEntitySpawnEvent
package net.minecraftforge.debug;
import net.minecraft.entity.passive.EntityCow;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.BabyEntitySpawnEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
@Mod(modid = BreedingTest.MODID, name = "BreedingTest", version = "1.0")