Skip to content

Instantly share code, notes, and snippets.

@locus84
locus84 / CodeLlama-7b-Instruct-hf.md
Created September 19, 2024 11:22 — forked from chunhualiao/CodeLlama-7b-Instruct-hf.md
Example code to use CodeLlama 7B Instruct model HuggingFace version
@locus84
locus84 / CachedTest.cs
Created January 10, 2024 16:17
Cached Delegates in c#
using System;
public class C {
public void Start(int a)
{
TakeAction1(Foo); //allocate
TakeAction1(FooStatic); //allocate
TakeAction1(() => Foo()); //allocate
TakeAction1(() => FooStatic()); //cached
@locus84
locus84 / .UIDocumentLocalization.cs.md
Created October 21, 2023 16:41 — forked from andrew-raphael-lukasik/.UIDocumentLocalization.cs.md
Text localization script for UIDocument (UI Toolkit @ Unity)

pattern to follow

// NOTE: this class assumes that you designate StringTable keys in label fields (as seen in Label, Button, etc) // and start them all with '#' char (so other labels will be left be)

@locus84
locus84 / .remote_bash_profile
Last active August 1, 2020 14:52
my bash_profile alias and so on...
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) machine=Linux;;
Darwin*) machine=Mac;;
CYGWIN*) machine=Cygwin;;
MINGW*) machine=MinGw;;
*) machine="UNKNOWN:${unameOut}"
esac
echo "Detected Env : $machine"
@locus84
locus84 / RemoteDotnet.csx
Created May 20, 2020 17:06
test dotnet-script remote file
Console.WriteLine("Hello From Gist");
@locus84
locus84 / InGameDebugConsole.cs
Created May 14, 2020 18:36
In-Game Console for unity (Landscape optimized)
using System;
using UnityEngine;
using System.Collections.Generic;
using System.Collections.ObjectModel;
public class InGameDebugConsole : MonoBehaviour
{
List<string> whiteStrings = new List<string>();
[RuntimeInitializeOnLoadMethod]
static void Setup()
{
@locus84
locus84 / CustomAnnotation
Last active May 12, 2020 10:16
protobuf custom annotation
커스텀 옵션 받아오는 방법
MessageOption, FieldOption등등 여러가지가 있다.
자세한 것은 https://developers.google.com/protocol-buffers/docs/proto#customoptions 에서 볼 수 있다.
옵션에 관해서는 https://developers.google.com/protocol-buffers/docs/proto3#options 참고
```
syntax="proto3";
import "google/protobuf/descriptor.proto";
message FooOptions {