Skip to content

Instantly share code, notes, and snippets.

@hybridherbst
hybridherbst / Fixup.cs
Last active August 19, 2019 13:31
Quill Fixup. Make sure to adjust the name filter in FixupPostprocessor for your pipeline BEFORE you drop these into an Editor folder.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Linq;
namespace pfc.WeirdQuillFixup
{
public static class Fixup
{
public static void FixMeshInPlace(Mesh mesh)
@hybridherbst
hybridherbst / Electron app decompiling
Created April 12, 2020 23:17 — forked from yassineaboukir/Electron app decompiling
Obtain the source code of Electron applications
# Open terminal and install asar node module globally
$ npm install -g asar
# Go into the app’s directory, in our case it’s Slack
$ cd /Applications/Slack.app/Contents/Resources
# Create a directory to paste the content of app

Keybase proof

I hereby claim:

  • I am hybridherbst on github.
  • I am fherbst (https://keybase.io/fherbst) on keybase.
  • I have a public key ASBcXOr6y9MoixUoBn700ot44MYsVODKHmevksm67nZSbAo

To claim this, I am signing this object:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
public static class LogEmojis
{
[MenuItem("needle/Log interesting chars from Inter")]
static void LogInterestingCharsToConsole()
{
@hybridherbst
hybridherbst / DragAndDropEditorWindow.cs
Created October 10, 2020 21:22 — forked from rutcreate/DragAndDropEditorWindow.cs
How to use DragAndDrop function in Unity3D custom editor. This is just handle when user drag anything outside to THIS EditorWindow only.
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
public class DragAndDropEditorWindow : EditorWindow
{
[MenuItem("Window/Drag And Drop")]
public static void Open()
{
@hybridherbst
hybridherbst / SetThreadCount.cs
Created January 15, 2021 15:56
Set the number of concurrent compiler threads for Unity3D
using System;
using System.Reflection;
using UnityEditor;
using UnityEngine;
public static class SetThreadCount
{
[InitializeOnLoadMethod]
static void Init()
{
@hybridherbst
hybridherbst / ChangeHideFlags.cs
Created February 9, 2021 15:55
Show all objects - disable HideFlags
using UnityEditor;
using UnityEngine;
using UnityEngine.SceneManagement;
public static class ChangeHideflags
{
[MenuItem("Tools/Show All for Selection")]
static void ShowAllChilds()
{
var t = Selection.activeTransform;
@hybridherbst
hybridherbst / gist:90d554dfb6791517acb2d75af6baf516
Last active November 26, 2021 16:12
Unity PlayerPref & EditorPref hash handling
// Unity hashes PlayerPref names to make them case-sensitive
// (Windows Registry isn't case sensitive otherwise)
private static string ToKey(string prefName)
{
return prefName + "_h" + Hash(prefName);
}
// djb2-xor hash method
private static uint Hash(string str)
@hybridherbst
hybridherbst / index.html
Created November 29, 2021 23:07
Twitter Player Card Meta Example
<!-- Original URL: https://prefrontalcortex.de/labs/model-viewer/upload/Tyrlefing/ -->
<!-- Twitter Card, also unfurls in Slack/Discord etc. -->
<meta name="twitter:card" content="player" />
<meta name="twitter:site" content="hybridherbst" />
<meta name="twitter:player" content="https://prefrontalcortex.de/labs/model-viewer/upload/Tyrlefing/index.html" />
<meta name="twitter:player:width" content="480" />
<meta name="twitter:player:height" content="480" />
<meta property="og:image" content="https://prefrontalcortex.de/labs/model-viewer/upload/Tyrlefing/20211100-231259-poster.webp" />
<meta property="og:title" content="Tyrlefing" />
@hybridherbst
hybridherbst / utf8-stress-test.txt
Last active December 3, 2021 23:56
UTF8 Stress Test ₧₪№↨בּשּׂ؟⇶♚❂☈☃ ҉ↂ✂❧☠℥
Probably most complete version:
₧₪№↨בּשּׂ؟⇶♚❂☈☃ ҉ↂ✂❧☠℥
Copied with Windows Clipboard from Discord Status to Gist
₧₪№↨בּשּׂ؟⇶♚❂☈ ҉ↂ❧℥
Copied with Android Clipboard from Hangouts Status to Gist
₧₪№↨בּשּׂ؟⇶♚❂☈☃ ҉ↂ✂❧☠℥‎‎‎‎‎‎‎‎‎‎