Skip to content

Instantly share code, notes, and snippets.

View b0o's full-sized avatar
👻
Boo!

Maddison Hellstrom b0o

👻
Boo!
View GitHub Profile
static const char* const sourceDataPath = R"(C:\Temp\2remove\vectors.csv)";
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <chrono>
#include <immintrin.h>
#include <assert.h>
using namespace std;
using namespace std::chrono;
static const char* const sourceDataPath = R"(C:\Temp\2remove\vectors.csv)";
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <chrono>
#include <immintrin.h>
using namespace std;
using namespace std::chrono;
constexpr int SIZE = 640000;
import llama_cpp
import re
import json
# Model configuration
# tested with mistral, llama2, llama3, and phi3
model_path = "/path/to/model"
base_llm = llama_cpp.Llama(model_path, seed=42, n_gpu_layers=-1, n_ctx=4096, verbose=False, temperature=0.0)
@kj800x
kj800x / Hacking the LG Monitor's EDID.md
Last active September 12, 2024 23:46
Hacking the LG Monitor's EDID

preface: Posting these online since it sounds like these notes are somewhat interesting based on a few folks I've shared with. These are semi-rough notes that I basically wrote for myself in case I ever needed to revisit this fix, so keep that in mind.

I recently bought an LG ULTRAGEAR monitor secondhand off of a coworker. I really love it and it's been great so far, but I ran into some minor issues with it in Linux. It works great on both Mac and Windows, but on Linux it displays just a black panel until I use the second monitor to go in and reduce the refresh rate down to 60 Hz.

This has worked decent so far but there's some issues:

  • It doesn't work while linux is booting up. The motherboards boot sequence is visible just fine, but as soon as control is handed over to Linux and I'd normally see a splash screen while I'm waiting for my login window, I see nothing.
  • It doesn't work on the login screen. This would be fine if login consistently worked on my second screen, but I need to manually switch
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gunhaxxor
gunhaxxor / client.ts
Last active May 28, 2023 08:56
TRPC adapter for uWebsockets.js. The ws-adapter is a modified version of the original ws-adapter in the TRPC repo. Also added some utility functions to make it easier to setup subscriptions that don't send data to the triggering client.
import {
createTRPCProxyClient,
createWSClient,
wsLink,
} from '@trpc/client';
import { Unsubscribable } from '@trpc/server/observable';
import AbortController from 'abort-controller';
import fetch from 'node-fetch';
import ws from 'ws';
import type { AppRouter } from './server';
@WebReflection
WebReflection / esx.md
Last active October 6, 2024 12:35
Proposal: an ESX for JS implementation
@smjonas
smjonas / inc_rename.lua
Last active March 1, 2023 14:45
Incremental LSP rename command based on Neovim's command-preview feature
-- Usage: type :IncrementalRename <new_name> while your cursor is placed above an identifier (LSP must be enabled)
-- Update: this gist will no longer be updated since this command has been turned into a plugin!
-- You can find the plugin here: https://github.com/smjonas/inc-rename.nvim
local state = {
added_lines = false,
orig_lines = {},
lsp_positions = {},
}
@motorailgun
motorailgun / idea.md
Last active June 18, 2024 06:22
Installing Windows and Linux into the same partition

Installing Windows and Linux into the same partition

But WHY?

There was a reddit post about installing Arch on NTFS3 partition. Since Windows and Linux doesn't have directories with same names under the /(C:\), I thought it's possible, and turned out it was actually possible.
If you are not familiar to Linux, for example you've searched on Google "how to dualboot Linux and Windos" or brbrbr... you mustn't try this. This is not practical.

Pre-requirements

  • UEFI system
  • Any Linux live-boot CD/DVD/USB... with Linux kernel newer than 5.15
  • Windows installer USB
@luther9
luther9 / monty-hall.lua
Created November 18, 2021 17:33
IO monad in Lua
#!/usr/bin/env lua
local IO
IO = {
-- Class method. Create an IO that does nothing and returns x.
unit = function(x)
return IO(function() return x end)
end,