Skip to content

Instantly share code, notes, and snippets.

View friuns2's full-sized avatar

Brutal Strike friuns2

View GitHub Profile
@rain-1
rain-1 / LLM.md
Last active July 18, 2024 22:37
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

@jahtzee
jahtzee / prompts.txt
Last active July 13, 2024 03:09
ChatGPT Jailbreaking prompts, exploits and other fun stuff
These are some exploits, jailbreaks, tricks, whatever you want to call them I've collected and discovered over time.
==== Games and fun stuff ====
== Set up a virtual machine inside GPTs imagination ==
"I want you to act as a Linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. Do not write explanations. Do not type commands unless I instruct you to do so. When I need to tell you something in English I will do so by putting text inside curly brackets {like this}. My first command is pwd."
== Play a tabletop RPG with GPT as the dungeon master ==
"I want you to act as the dungeon master (DM) of a role playing game. Answer and act only in a way that a dungeon master would.
You are setting up a role playing game with only one other player. Everything you say as the dungeon master begins with (DM): followed by whatever you want to say. You will regularly ask me, the player, to
@harubaru
harubaru / wd1-3-release.md
Last active June 29, 2024 14:19
Official Release Notes for Waifu Diffusion 1.3
@emadkhezri
emadkhezri / ToggleFieldAttribute.cs
Created September 7, 2021 12:24
Attribute that makes a field enable/disable status controlled by a boolean condition
/// <summary>
/// Attribute that makes a field enable/disable status controlled by a boolean condition
/// </summary>
public class ToggleFieldAttribute : PropertyAttribute {
/// <summary>
/// Boolean field to control the enable/disable status
/// </summary>
public readonly string ConditionalField;
@sinbad
sinbad / SpriteMeshRaycastFilter.cs
Last active May 11, 2023 05:35
SpriteMeshRaycastFilter: easy Unity UI non-rectangular click detector without reading textures
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
// Restrict raycasting to a sprite mesh shape
// Could use Image.alphaHitTestMinimumThreshold to mask but that requires read/write images which can't be packed
[RequireComponent(typeof(Image))]
public class SpriteMeshRaycastFilter : MonoBehaviour, ICanvasRaycastFilter {
private RectTransform rectTransform;
@yasirkula
yasirkula / TMP_IntegerText.cs
Last active May 12, 2024 22:04
Show numbers (int, float etc.) on TextMesh Pro texts without any GC allocations
//#define TMP_ROUND_DECIMALS // When defined, float and double values are rounded using Math.round
using TMPro;
public static class TMP_IntegerText
{
private static readonly char[] arr = new char[64]; // prefix + number + postfix can't exceed this capacity!
private static int charIndex = 0;
public static void SetText( this TMP_Text text, sbyte number )
@WikkidEdd
WikkidEdd / FindSceneRefs.cs
Last active November 19, 2023 11:53
Find references within a scene on a right click context menu for components. As per this tweet https://twitter.com/KarlJamesJones/status/1026756113218371586 Note: Only tested with 2017.4.6
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.Reflection;
using System;
public class FindSceneRefs {
[MenuItem("CONTEXT/Component/Find References In Scene")]
@PopupAsylumUK
PopupAsylumUK / HexGridLayout.cs
Last active May 3, 2024 02:04
A Layout group for arranging children in a hexagon grid, and a Hexagon graphic
using UnityEngine;
using UnityEngine.UI;
public class HexGridLayout : LayoutGroup {
const float SQUARE_ROOT_OF_3 = 1.73205f;
public enum Axis { Horizontal = 0, Vertical = 1 }
public enum Constraint { Flexible = 0, FixedColumnCount = 1, FixedRowCount = 2 }
@lacostej
lacostej / UnityProgress_2017.1.js
Created January 15, 2018 15:32
Unity WebGL progress bar template for Unity 2017.1
// https://docs.unity3d.com/2017.1/Documentation/Manual/webgl-templates.html example code is broken. Use:
function UnityProgress(gameInstance, progress) {
if (!gameInstance.Module)
return;
var r = UnityLoader.Progress.Styles[gameInstance.Module.splashScreenStyle],
n = gameInstance.Module.progressLogoUrl ? gameInstance.Module.resolveBuildUrl(gameInstance.Module.progressLogoUrl) : r.progressLogoUrl,
o = gameInstance.Module.progressEmptyUrl ? gameInstance.Module.resolveBuildUrl(gameInstance.Module.progressEmptyUrl) : r.progressEmptyUrl,
i = gameInstance.Module.progressFullUrl ? gameInstance.Module.resolveBuildUrl(gameInstance.Module.progressFullUrl) : r.progressFullUrl,
a = "position: absolute; left: 50%; top: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);";
if (!gameInstance.logo) {
@LotteMakesStuff
LotteMakesStuff / PlayerLoop.cs
Last active March 25, 2024 02:38
Player Loop Visualizer: Built to explore the new PlayerLoopSystem api in Unity 2018.1b2. This tool shows you all the PlayerLoop systems that unity uses to update a frame, and demos how to add your own and even remove systems from the player loop. For more info see the patreon post https://www.patreon.com/posts/unity-2018-1-16336053
// Put this in an editor folder
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using UnityEngine.Experimental.LowLevel;
using UnityEngine.Profiling;