Skip to content

Instantly share code, notes, and snippets.

View Laeeth's full-sized avatar

Laeeth Isharc Laeeth

View GitHub Profile
@Laeeth
Laeeth / chararraymarshal.cs
Created May 5, 2018 12:34
csharp marshalling code
using System;
using System.Dynamic;
using System.Runtime.InteropServices;
namespace Symmetry.Xenon.Model.Marshalling
{
/**
* Base for Marshallers which need a buffer and a size - basically for wrapping binary data.
*/
public abstract class CharArrayMarshaller : DualAllocationMarshaller
@Laeeth
Laeeth / rename-pictures.sh
Created February 18, 2024 02:14 — forked from jart/rename-pictures.sh
Shell script for renaming all images in a folder
#!/bin/sh
# rename-pictures.sh
# Author: Justine Tunney <jtunney@gmail.com>
# License: Apache 2.0
#
# This shell script can be used to ensure all the images in a folder
# have good descriptive filenames that are written in English. It's
# based on the Mistral 7b and LLaVA v1.5 models.
#
# For example, the following command:
@Laeeth
Laeeth / long_gpt.py
Created April 13, 2023 04:17 — forked from NaxAlpha/long_gpt.py
Training script for LongGPT; Fine-tunes GPT-2 (335M) on The Pile Dataset with a context size of 8k tokens. (requires > 16GB RAM)
import time
from contextlib import suppress
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch.backends.cuda as cuda
from torch.utils.data import DataLoader, IterableDataset
@Laeeth
Laeeth / Hyperinflation.md
Created April 7, 2023 05:08
GPT recommendations on reading about inflation

Open sidebar Books on inflation periods.

Model: Default (GPT-3.5)

laeeth@kaleidic.io What are some books on previous large inflationary and hyperinflationary periods

Here are some books on previous large inflationary and hyperinflationary periods:

@Laeeth
Laeeth / can-llms-do-abduction.md
Last active April 5, 2023 03:30
Can Large Language Models do Abduction? Chat GPT answers

Are LLMs able to do abductive reasoning?

Yes, LLMs (Large Language Models) such as GPT-3 have demonstrated the ability to perform abductive reasoning to a certain extent. Abductive reasoning involves making an inference based on the best available explanation of observed phenomena or data.

LLMs achieve this by analyzing large amounts of data and generating probabilistic predictions based on patterns and relationships found in the data. In the context of natural language processing, this can involve generating hypotheses about the meaning of a sentence or paragraph based on the surrounding context.

However, it's important to note that LLMs are not perfect and their abductive reasoning abilities are not always reliable. They may make incorrect inferences or struggle with more complex reasoning tasks. Additionally, their reasoning abilities may be limited by the quality and diversity of the data they are trained on.

Can LLMs reason like Sherlock Holmes in The Dog That Did Not Bark in the Night?

@Laeeth
Laeeth / OVERLAYFS
Created April 8, 2021 01:02 — forked from mutability/OVERLAYFS
readonly root via overlayfs
- install the two shellscripts into the appropriate places under /etc/initramfs-tools
- run update-initramfs
- put "overlay=yes" on the kernel command line
- reboot
With the overlay in place, the real root is mounted readonly on /ro.
Only the root fs is changed, other filesystems are mounted normally.
Remove "overlay=yes" (or change it to something other than yes) and reboot to go back to readwrite.
(This probably means that you want the commandline config to live somewhere other than on the root fs, e.g. under /boot)
@Laeeth
Laeeth / gist:7d63d1c7022f2bd3f4a83f4098361327
Created April 7, 2021 17:19 — forked from rolandcrosby/gist:c26571bf4e263f695d2f
Convert rich text on the clipboard to Markdown
if encoded=`osascript -e 'the clipboard as «class HTML»'` 2>/dev/null; then echo $encoded | perl -ne 'print chr foreach unpack("C*",pack("H*",substr($_,11,-3)))' | pandoc --no-wrap -f HTML -t markdown; else; pbpaste; fi
# for my .vimrc:
# command PasteMarkdown :read !if encoded=`osascript -e 'the clipboard as «class HTML»'` 2>/dev/null; then echo $encoded | perl -ne 'print chr foreach unpack("C*",pack("H*",substr($_,11,-3)))' | pandoc --no-wrap -f HTML -t markdown; else; pbpaste; fi
# nnoremap ,pmd :PasteMarkdown<CR>

Why I think Immediate Mode GUI is way to go for GameDev tools

Prerequisites

Before you continue, if you don't know what IMGUI is don't bother reading this post, just ignore it, don't write anything in comments section, etc. If you're curious about IMGUI see bottom of this post, otherwise continue whatever you were doing, this post it's not for you. Thanks!

If you know what IMGUI is, for context read following presentations and blog posts:

  • Insomniac’s Web Tools Postmortem
@Laeeth
Laeeth / key.md
Created November 21, 2020 21:36
Twitter (un)official Consumer Key

Twitter Official Consumer Key

Twitter for Android

type:            PIN
Consumer key:    3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPhone

type:            PIN

Consumer key: IQKbtAYlXLripLGPWd0HUA

@Laeeth
Laeeth / get_recursive.d
Created February 21, 2020 19:30 — forked from schveiguy/get_recursive.d
Another recursive range possibility, using simple linked-list stack.
import std.range;
struct StackFrame(T)
{
StackFrame* prev;
T range;
}
struct StackRange(T, alias recurse) if (isInputRange!(typeof(recurse(T.init))))
{