Skip to content

Instantly share code, notes, and snippets.

@HugsLibRecordKeeper
HugsLibRecordKeeper / output_log.txt
Created February 7, 2025 22:33
Rimworld output log published using HugsLib
Log uploaded on Friday, February 7, 2025, 11:33:21 PM
Loaded mods:
Harmony(brrainz.harmony)[mv:2.3.1.0]: 0Harmony(2.3.3), HarmonyMod(2.3.1)
Core(Ludeon.RimWorld): (no assemblies)
HugsLib(UnlimitedHugs.HugsLib)[ov:11.0.4]: 0Harmony(av:2.3.3,fv:1.2.0.1), HugsLib(av:1.0.0,fv:11.0.4)
Fences And No Floors(drzhivago.fencesandnofloors): (no assemblies)
More Trade Ships(PinoChemicali.MoreTradeShips): (no assemblies)
Removable Mt.Rock Roof Patch(Proxyer.RemovableMtRockRoofPatche): (no assemblies)
Wall Light(Murmur.WallLight): WallLight(av:1.5.8874.26767,fv:1.0.0)
Tilled Soil(GT.Sam.TilledSoil): (no assemblies)
@gordonbrander
gordonbrander / actor.ts
Last active February 7, 2025 23:55
Simple actors with async and TransformStream
import { type Receive, type Send, useMailbox } from "./mailbox.ts";
export type Context<Msg> = {
self: string;
send: (id: string, msg: Msg) => Promise<void>;
receive: Receive<Msg>;
spawn: (id: string, actor: Actor<Msg>) => string;
};
export type Actor<Msg> = (context: Context<Msg>) => Promise<void>;
@soodk6
soodk6 / patch.py
Created February 7, 2025 22:31
CPSC 375 - Monkey patch Lets-Plot to render correctly in Colab2PDF
# This goes after the call to LetsPlot.setup_html(),
# but before calling ggplot().
def setup_colab2pdf():
def _repr_svg_(self):
from io import BytesIO
from sys import stdout
file_like = BytesIO()
self.to_svg(file_like)
return file_like.getvalue().decode(stdout.encoding)
@forkyau
forkyau / hourly_rainfall_data-2025-02-08|06-15.csv
Created February 7, 2025 22:31
GIST created by python code
id station stationid value unit obstime date
0 流浮山 RF001 0 mm 2025-02-08T06:15:00+08:00 2025-02-08
1 湿地公园 RF002 0 mm 2025-02-08T06:15:00+08:00 2025-02-08
2 水边围 N12 0 mm 2025-02-08T06:15:00+08:00 2025-02-08
3 石岗 RF003 0 mm 2025-02-08T06:15:00+08:00 2025-02-08
4 大美督 RF004 0 mm 2025-02-08T06:15:00+08:00 2025-02-08
5 大埔墟 RF005 0 mm 2025-02-08T06:15:00+08:00 2025-02-08
6 北潭涌 RF006 0 mm 2025-02-08T06:15:00+08:00 2025-02-08
7 滘西洲 RF007 0 mm 2025-02-08T06:15:00+08:00 2025-02-08
8 西贡 N15 0 mm 2025-02-08T06:15:00+08:00 2025-02-08
@stepbrobd
stepbrobd / query_tree.py
Last active February 7, 2025 22:54
query an immutable tree
"""
Problem:
Given an immutable tree (where each node is identified by a unique ID and contains a list of children),
write a function to process queries that ask for the n-th parent (iteratively climbing upwards) of a node.
Preprocessing is allowed (in below code, all lines that are used to populating cache are considered as preprocessing),
want fastest average query time, allow some space complexity.
Time complexity: O(log(n))
Space complexity: O(n*log(n))
"""
@HugsLibRecordKeeper
HugsLibRecordKeeper / output_log.txt
Created February 7, 2025 22:29
Rimworld output log published using HugsLib
Log uploaded on Friday, February 7, 2025, 3:29:36 PM
Loaded mods:
Prepatcher(zetrith.prepatcher): 0Harmony(2.3.3), 0PrepatcherAPI(1.2.0), 0PrepatcherDataAssembly(1.0.0), PrepatcherImpl(1.0.0), Prestarter(1.0.0)
Harmony(brrainz.harmony)[mv:2.3.1.0]: 0Harmony(2.3.3), HarmonyMod(2.3.1)
Fishery - Modding Library(bs.fishery): 0PrepatcherAPI(1.2.0), 1Fishery(0.6.0), System.Runtime.CompilerServices.Unsafe(av:6.0.0,fv:6.0.21.52210)
Core(Ludeon.RimWorld): (no assemblies)
Performance Fish(bs.performance): PerformanceFish(0.6.0)
Royalty(Ludeon.RimWorld.Royalty): (no assemblies)
Ideology(Ludeon.RimWorld.Ideology): (no assemblies)
Biotech(Ludeon.RimWorld.Biotech): (no assemblies)
Console.WriteLine("Сколько у вас золото?....");
int quantityGold = Convert.ToInt32(Console.ReadLine());
const float crystalPerGold = 0.69F;
Console.WriteLine($"На сколько Кристал желайте поменить?\n стоимость золота: {crystalPerGold} Кристал");
int quantityCristal = Convert.ToInt32(Console.ReadLine());
float restGold = quantityGold - (quantityCristal/crystalPerGold);
Console.WriteLine($"Вы получите {quantityCristal} и остается {restGold}k ");
name: expert
channels:
- conda-forge
- defaults
dependencies:
- _libgcc_mutex=0.1=conda_forge
- _openmp_mutex=4.5=2_gnu
- _r-mutex=1.0.0=anacondar_1
- _sysroot_linux-64_curr_repodata_hack=3=haa98f57_10
- atk-1.0=2.36.0=ha1a6a79_0
@lvanasse
lvanasse / ci-risc-v-03.log
Created February 7, 2025 22:27
[risc-v-03] CI Log for nuttx @ ca6f5db6fc5d24ebe58be19c1cd7a5d0df856a64 / nuttx-apps @ fb0c1e10ded2a6fb9f066b9893662cbcc86e4646
Script started on 2025-02-07 21:46:11+00:00 [COMMAND="/home/ludovic/nuttx-release/run-job.sh risc-v-03" <not executed on terminal>]
Now running https://github.com/lupyuen/nuttx-release/blob/main/run-job.sh
Called by https://github.com/lupyuen/nuttx-release/blob/main/run-ci.sh
+ job=risc-v-03
+ neofetch
.-/+oossssoo+/-.
`:+ssssssssssssssssss+:`
-+ssssssssssssssssssyyssss+-
.ossssssssssssssssssdMMMNysssso.
/ssssssssssshdmmNNmmyNMMMMhssssss/
@imeMFK01
imeMFK01 / grpo_demo.py
Created February 7, 2025 22:26 — forked from willccbb/grpo_demo.py
GRPO Llama-1B
# train_grpo.py
import re
import torch
from datasets import load_dataset, Dataset
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import LoraConfig
from trl import GRPOConfig, GRPOTrainer
# Load and prep dataset