Skip to content

Instantly share code, notes, and snippets.

View doctorpangloss's full-sized avatar

Benjamin Berman doctorpangloss

View GitHub Profile
import math
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision.transforms as TT
from PIL import Image
from einops import rearrange
from einops.layers.torch import Rearrange
@doctorpangloss
doctorpangloss / containerd-1.7.2.yaml
Created June 22, 2023 22:59
upgrades containerd on windows for GKE
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: containerd-upgrade
namespace: kube-system
spec:
selector:
matchLabels:
name: containerd-upgrade
template:
@doctorpangloss
doctorpangloss / hdrp.patch
Created July 16, 2022 00:51
patch for hdrp reflection probe culling issue
diff --git a/Packages/com.unity.render-pipelines.high-definition@12.1.7/Runtime/RenderPipeline/HDRenderPipeline.cs b/Packages/com.unity.render-pipelines.high-definition@12.1.7/Runtime/RenderPipeline/HDRenderPipeline.cs
index 34918678..6997fe2e 100644
--- a/Packages/com.unity.render-pipelines.high-definition@12.1.7/Runtime/RenderPipeline/HDRenderPipeline.cs
+++ b/Packages/com.unity.render-pipelines.high-definition@12.1.7/Runtime/RenderPipeline/HDRenderPipeline.cs
@@ -1334,6 +1334,14 @@ namespace UnityEngine.Rendering.HighDefinition
hdCamera.RequestDynamicResolution(cameraRequestedDynamicRes, dynResHandler);
+ // Force add all the HDProbes
+ var allProbes = GameObject.FindObjectsOfType<HDProbe>();
+ cullingResults.hdProbeCullingResults.Reset();
+ foreach (var probe in allProbes)
@doctorpangloss
doctorpangloss / GrpcExtensions.cs
Created October 7, 2021 16:46
Improving semantics around gRPC on Unity
using System;
using System.Collections.Generic;
using Grpc.Core;
using UniRx;
using UniRx.Diagnostics;
using UnityEngine;
using System;
using System.Collections.Concurrent;
using System.Threading;
using Cysharp.Threading.Tasks;
[*]
trim_trailing_whitespace=false
charset=utf-8
end_of_line=lf
insert_final_newline=false
indent_style=space
indent_size=4
# Microsoft .NET properties
csharp_new_line_before_members_in_object_initializers=false
{
"data-root" : "/var/packages/Docker/target/docker",
"log-driver" : "json-file",
"registry-mirrors" : [],
"group": "administrators"
}
#if !UniRxLibrary
using ObservableUnity = UniRx.Observable;
#endif
using System;
using System.Collections;
using UnityEngine;
using UnityEngine.Networking;
using Hash = System.Collections.Generic.Dictionary<string, string>;
package com.hiddenswitch.spellsource.applications;
import com.hiddenswitch.spellsource.Broadcaster;
import com.hiddenswitch.spellsource.Gateway;
import com.hiddenswitch.spellsource.Spellsource;
import com.hiddenswitch.spellsource.Tracing;
import com.hiddenswitch.spellsource.util.Logging;
import com.hiddenswitch.spellsource.util.Mongo;
import com.hiddenswitch.spellsource.util.RpcClient;
import io.vertx.core.Vertx;
#!/usr/bin/env bash
brew install python3
pip3 install virtualenv
cd ~/Documents
virtualenv --python=python3 Environment
source Environment/bin/activate
pip3 install jupyter
jupyter notebook
@doctorpangloss
doctorpangloss / repetition_algorithm.ipynb
Last active November 23, 2023 19:13
Supermemo 2 Algorithm, Unobscured (Python 3)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.