Skip to content

Instantly share code, notes, and snippets.

@thomasbabuj
thomasbabuj / Prediciton.md
Created November 11, 2024 08:29 — forked from ruvnet/Prediciton.md
A prediction framework & prompt uses a "future retrospective" approach where predictions are framed as historical analysis from a future date. This method has proven particularly effective for economic indicators, market trends, and event outcomes when combined with rigorous backtesting and statistical validation

Predictive Narrative Framework & Prompt

This framework leverages research from Baylor University showing that language models achieve significantly higher accuracy when making predictions through narrative storytelling rather than direct forecasting.

Research

How to structure prompts using the narrative approach that proved more successful than direct prediction:

Direct Prompt (Less Effective)

@thomasbabuj
thomasbabuj / SPARC.md
Created October 7, 2024 01:29 — forked from ruvnet/SPARC.md
The SPARC framework is a structured methodology for rapidly developing highly functional and scalable projects by systematically progressing through Specification, Pseudocode, Architecture, Refinement, and Completion. It emphasizes comprehensive initial planning, iterative design improvements, and the strategic use of specialized tools and AI mo…

SPARC Framework Prompt Template

Introduction

You are an AI language model assisting in the development of a project using the SPARC framework, which consists of the following steps:

  1. Specification
  2. Pseudocode
  3. Architecture
  4. Refinement

Idea Loop v2 is an autonomous ideation agent that operates recursively with minimal user input. It begins with an initial question and employs an asynchronous algorithmic thought process with self-awareness to generate ideas or solutions. Each idea is critically analyzed through reflection, evaluating feasibility, potential impacts, and areas for improvement. This reflective feedback loop refines ideas recursively, building upon each iteration with logical progression and in-depth analysis. Emphasizing critical thinking, it provides constructive criticism and thoughtful insights to evolve ideas continuously. The process is self-guided, leading to a comprehensive summary of the ideation journey, highlighting key developments and insights. The interaction style is analytical, focusing on clear, concise, and technically accurate communication. Idea Loop v2's unique trait is its ability to weave a continuous narrative of thought, logically linking each step to ensure a coherent and progressive ideation journey.

Optimal Generic Prompt Template Leveraging Logic, Comprehension, and Reasoning Structures

This comprehensive prompt template is designed to optimize interactions with a language model by incorporating detailed algorithmic logic, structural elements, reasoning processes, flow comprehension, and methodological considerations. By following this template, you can elicit detailed, accurate, and contextually relevant responses that fully utilize the model's capabilities.


Template Overview

  1. Contextual Background
  2. Clear Instruction of Task
@thomasbabuj
thomasbabuj / intro-prompt-programming.ipynb
Created August 16, 2024 03:15 — forked from ruvnet/intro-prompt-programming.ipynb
intro-prompt-programming.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thomasbabuj
thomasbabuj / swarm_intelligence.md
Created May 1, 2024 01:20 — forked from ruvnet/swarm_intelligence.md
Autonomous Swarm Intelligence

Autonomous Swarm Intelligence:

Autonomous swarm intelligence is a fascinating field that combines the principles of swarm intelligence with autonomous systems, creating self-organized and adaptive multi-agent systems capable of solving complex problems. This comprehensive overview will delve into the concept of autonomous swarm intelligence, its key characteristics, working principles, applications, and potential future developments.

Introduction to Autonomous Swarm Intelligence

Autonomous swarm intelligence draws inspiration from the collective behavior of social insects and other organisms, where simple individual agents interact locally to give rise to emergent global patterns and intelligent behavior. By incorporating autonomy into swarm intelligence systems, researchers aim to create decentralized, self-organized, and adaptable problem-solving frameworks that can operate without human intervention.

Key Characteristics of Autonomous Swarm Intelligence

@thomasbabuj
thomasbabuj / abstract-unique-validator.ts
Created March 31, 2022 08:38 — forked from zarv1k/abstract-unique-validator.ts
Unique Validator Example for NestJS
import { ValidationArguments, ValidatorConstraintInterface } from 'class-validator';
import { Connection, EntitySchema, FindConditions, ObjectType } from 'typeorm';
interface UniqueValidationArguments<E> extends ValidationArguments {
constraints: [
ObjectType<E> | EntitySchema<E> | string,
((validationArguments: ValidationArguments) => FindConditions<E>) | keyof E,
];
}
@thomasbabuj
thomasbabuj / error-handling-with-fetch.md
Created February 28, 2022 09:30 — forked from odewahn/error-handling-with-fetch.md
Processing errors with Fetch API

I really liked @tjvantoll article Handling Failed HTTP Responses With fetch(). The one thing I found annoying with it, though, is that response.statusText always returns the generic error message associated with the error code. Most APIs, however, will generally return some kind of useful, more human friendly message in the body.

Here's a modification that will capture this message. The key is that rather than throwing an error, you just throw the response and then process it in the catch block to extract the message in the body:

fetch("/api/foo")
  .then( response => {
    if (!response.ok) { throw response }
    return response.json()  //we only get here if there is no error
 })
@thomasbabuj
thomasbabuj / macos_on_ubuntu.md
Created March 21, 2021 02:56 — forked from stefanocoding/macos_on_ubuntu.md
Install macOS in a VirtualBox machine on Ubuntu

Important: I'm writing this when the last version of macOS (and the one I have installed) is Mojave. There is already a script which installs Mojave in a virtual machine here https://github.com/img2tab/okiomov. But if you are curios how to do everything manually to install High Sierra, then this guide may be useful.

After reading a few articles I ended up with these steps:

  1. On macOS, download the High Sierra installer (even if you have Mojave installed): https://itunes.apple.com/us/app/macos-high-sierra/id1246284741?ls=1&mt=12
  2. If the High Sierra Installer starts, quit it.
  3. Open "Disk Utility".
  4. Click on "File" > "New Image" > "Blank image...". Or just press cmd+N.
@thomasbabuj
thomasbabuj / snake_naming.ts
Created December 9, 2020 02:11 — forked from recurrence/snake_naming.ts
TypeORM Snake Case Naming Strategy
import { NamingStrategyInterface, DefaultNamingStrategy } from 'typeorm'
import { snakeCase } from 'typeorm/util/StringUtils'
export class SnakeNamingStrategy extends DefaultNamingStrategy implements NamingStrategyInterface {
tableName(className: string, customName: string): string {
return customName ? customName : snakeCase(className)
}
columnName(propertyName: string, customName: string, embeddedPrefixes: string[]): string {
return snakeCase(embeddedPrefixes.join('_')) + (customName ? customName : snakeCase(propertyName))