Skip to content

Instantly share code, notes, and snippets.

View estebanfeldman's full-sized avatar
🏠
Working from home

Esteban Feldman estebanfeldman

🏠
Working from home
View GitHub Profile
@estebanfeldman
estebanfeldman / embeddings.py
Last active August 1, 2025 10:28
Embedding Utility class to use with a Local LM Studio embedding model
import requests
from langchain.embeddings.base import Embeddings
class LMStudioEmbeddings(Embeddings):
def __init__(
self,
endpoint,
model,
):
[
{
"id": 1767277531537744100,
"text": "I was so happy starting to use @zen_browser and then none of my streaming platforms work, and I found out that it doesn't support DRM content yet. 😢",
"time_posted": "1h ago"
},
{
"id": 1766014021033972000,
"text": "Streaming live, we are https://twitch.tv/108bits/",
"time_posted": "2h ago"
{
"success": true,
"credits_left": 100,
"rate_limit_left": 100,
"daily_rate_limit_left": 100,
"minute_rate_limit_left": 499,
"next_minute_rate_limit_reset": "2025-07-28T05:30:29.000Z",
"person": {
"publicIdentifier": "feldmane",
"linkedInIdentifier": "ACoAAAB1FpQBI_9O95Ft3KBFqVk7VjVpzEY3gms",
@estebanfeldman
estebanfeldman / app_logger.dart
Last active July 2, 2025 09:48
Simple App Logger Singleton
import 'package:logger/logger.dart';
class TimestampPrinter extends LogPrinter {
final LogPrinter _realPrinter;
TimestampPrinter(this._realPrinter);
@override
List<String> log(LogEvent event) {
final timestamp = DateTime.now().millisecondsSinceEpoch;
@estebanfeldman
estebanfeldman / gdlogger.gd
Last active June 20, 2024 07:19
Small Print wrapper for Godot that includes time and time in ms since play started - Add this to Autoload to use as Singleton
extends Node
func log(message: String) -> void:
print("-> %s %s %s " % [Time.get_time_string_from_system(), str(Time.get_ticks_msec()), message])
func _ready() -> void:
GDLogger.log("Logger services ready")
@estebanfeldman
estebanfeldman / SoundResource.cs
Last active April 30, 2024 07:15
Resource for cllients to play sounds and send to the AudioManager via GameEventsManager
using System.Linq;
using Godot;
using Godot.Collections;
public partial class SoundResource : Resource
{
[Export] public string Id { get; set; }
[Export] public AudioStream AudioStream { get; set; }
}
@estebanfeldman
estebanfeldman / GameEventsManager.cs
Last active May 29, 2024 13:12
EventBus for Godot Use in Autoload
using Godot;
using System;
public partial class GameEventsManager : Node
{
private static GameEventsManager _instance;
public static GameEventsManager Instance => _instance;
[Signal]
public delegate void UpdateWorldSpeedEventHandler(float speed);
using System.Linq;
using Godot;
using Godot.Collections;
public partial class AudioManager : Node
{
// ** needed sounds **
// Music
// shoot
// die
@estebanfeldman
estebanfeldman / uuid_generator.gd
Last active September 23, 2024 02:13
Poormans UUID Generator for Godot 4.x
extends Node
func generate_uuid_v4() -> String:
var uuid = PackedByteArray()
for i in range(16):
uuid.append(randi() % 256)
# Set the version to 4 (randomly generated UUID)
uuid[6] = (uuid[6] & 0x0F) | 0x40
# Set the variant to DCE 1.1, ITU-T X.667
uuid[8] = (uuid[8] & 0x3F) | 0x80
@estebanfeldman
estebanfeldman / ExplosiveBarrel.cpp
Created January 30, 2024 14:47
Using Interfaces to implement MagicProjectile hitting something
// Fill out your copyright notice in the Description page of Project Settings.
#include "ExplosiveBarrel.h"
#include "PhysicsEngine/RadialForceComponent.h"
// Sets default values
AExplosiveBarrel::AExplosiveBarrel()
{