Skip to content

Instantly share code, notes, and snippets.

@thakurvivek
thakurvivek / Liar-Ai.md
Created February 8, 2025 23:49 — forked from ruvnet/Liar-Ai.md
Liar Ai: Multi-Modal Lie Detection System

Multi-Modal Lie Detection System using an Agentic ReAct Approach: Step-by-Step Tutorial

Author: rUv
Created by: rUv, cause he could


WTF? The world's most powerful lie dector.

🤯 Zoom calls will never be the same. I think I might have just created the world’s most powerful lie detector tutorial using deep research.

@thakurvivek
thakurvivek / smart-llm.md
Created December 6, 2024 04:13 — forked from ruvnet/smart-llm.md
A cost-optimized proxy for routing between GPT-4o, Claude 3.5 Sonnet, and Gemini 1.5 Pro using LiteLLM.
@thakurvivek
thakurvivek / Mor.md
Created December 6, 2024 04:13 — forked from ruvnet/Mor.md
Mixture of Reflection (MoR) Model

Mixture of Reflection (MoR) Model: Detailed Implementation ## Forward: The Next Generation of AI Models

Reflection-based AI models are poised to redefine how AI is utilized, shifting from generating rapid, surface-level responses to producing thoughtful, in-depth analyses. These models emphasize self-evaluation and iterative improvement, leveraging internal feedback loops to refine outputs and enhance performance over multiple cycles.

This year has seen a marked shift toward reflection models, which differ from earlier Mixture of Experts (MoE) architectures. While MoE models efficiently handle specific tasks using specialized subnetworks, reflection-based models integrate iterative reasoning, enabling them to "think" before delivering results. This approach allows for evaluating and correcting reasoning pathways, ultimately improving performance through self-critique.

The proposed Mixture of Reflection (MoR) architecture builds on this foundation by combining the strengths of MoE with reflection-based re

Auto-Fixer Script

Introduction

The Auto-Fixer script is a powerful tool designed to automatically test and fix React components in a project. It leverages the London school of Test-Driven Development (TDD) and uses an AI-powered code assistant to iteratively improve failing tests and component code.

Features

  • Automatically runs tests for specified React components
  • Analyzes test failures and error messages
Shorter version:
Some people do not pursue their passions because of money earned in its pursuit.
Others pursue their passions because of money earned in its pursuit.
Slow version:
Some people do not pursue their passions because of (less) money earned in its pursuit. (Becoming an artist, Real passion)
Others pursue their passions because of (more) money earned in its pursuit. (Becoming an engineer, Forced passion)
Then there are people who find a middle ground (The third door finder) who pursue their passions and (more) money is just a side-effect.
==============SVN DIFF - MAC
To configure svn diff for FileMerge, you can try Wrapper to use OS X FileMerge when calling svn diff. In short, add below line to ~/.subversion/config
[helpers]
diff-cmd = <USER_HOME>/bin/svn-diffwrap.sh
In <USER_HOME>/bin/svn-diffwrap.sh
#!/bin/sh
/usr/bin/opendiff ${6} ${7}
@thakurvivek
thakurvivek / gist:a0046a77c71cd66084cdfb04c937f168
Last active November 25, 2016 11:17
Decoupled solutions nuggets
MVC - The Model is data, the View represents this data, the Controller is link between the Model and View.
Domain objects should be completely self contained and work without reference to the presentation, they should also be able to support multiple presentations, possibly simultaneously.You have a view-controller pair for each element of the screen, each of the controls and the screen as a whole. The views and controllers observe the model. When the model changes, the views react.
MVVM - View completely isolated of the model, the View is active and contains behaviors, events and data binding information.
View is not responsible for managing the state information. It is rather synchronized with the View Model. It is used to two-way bind data within views.
Not a good difference - This is usually a client-side implementation. MVC on the other hand is a way of separating concerns on the server-side.
Data binding engine makes sure the ui and the model are in sync. (Agent between view and model)
Notes from http://arjunsreedharan.org/post/82710718100/kernel-101-lets-write-a-kernel
Overview:
EIP(Instruction Pointer) with value 0xFFFF FFF0, also known as Reset Vector (RV)
RV's Value points to a memory location in BIOS
Shadowing begins: Copy BIOS to RAM for fsater access
Execute copied BIOS code
Search for Bootable devices (flag: 0xAA55 in byte 512 and 511 of the first sector)
Copy Bootable device's first sector starting from 0x7C00 to RAM, -> Bootloader
@thakurvivek
thakurvivek / gist:628f820c6472723cb0fbdfa46f2b47ba
Created October 17, 2016 04:53
Non Blocking vs Asynchronous
http://stackoverflow.com/questions/2625493/asynchronous-vs-non-blocking
http://stackoverflow.com/questions/10570246/what-is-non-blocking-or-asynchronous-i-o-in-node-js
The classic sockets API, a non-blocking socket is one that simply returns immediately with a special "would block" error message, whereas a blocking socket would have blocked. You have to use a separate function such as select or poll to find out when is a good time to retry.
Non-blocking means that if an answer can't be returned rapidly, the API returns immediately with an error and does nothing else. So there must be some related way to query whether the API is ready to be called (that is, to simulate a wait in an efficient way, to avoid manual polling in a tight loop).
Asynchronous means that the API always returns immediately, having started a "background" effort to fulfil your request, so there must be some related way to obtain the result.
Non blocking asynchronous IO in Node:
@thakurvivek
thakurvivek / gist:d4482f40a2d4f4b877a2bb9697b65b2e
Last active October 21, 2016 02:15
Handling many clients notes
Notes from https://www.scottklement.com/rpg/socktut/selectserver.html, http://stackoverflow.com/questions/5256599/what-are-file-descriptors-explained-in-simple-terms, http://www.kegel.com/c10k.html, https://www.quora.com/What-is-the-difference-between-user-level-and-kernel-level-threads
Problem: "BLOCKING" - each operation doesn't return control to our program until it has completed. We need to be able to read from whichever client actually sends data to us, without being stuck waiting for one that's not sending data to us.
IO Strategies for a networking software:
A) Whether and how to issue multiple I/O calls from a single thread
Don't; use blocking/synchronous calls throughout, and possibly use multiple threads or processes to achieve concurrency
Use nonblocking calls (e.g. write() on a socket set to O_NONBLOCK) to start I/O, and readiness notification (e.g. poll() or /dev/poll) to know when it's OK to start the next I/O on that channel. Generally only usable with network I/O, not disk I/O.