Skip to content

Instantly share code, notes, and snippets.

@emonidi
emonidi / tot.ts
Created May 24, 2023 16:17
Langchain.js Naive ToT implementation
import { models } from '../models'
import { LLMChain, SerializedLLMChain } from "langchain/chains";
import { PromptTemplate } from "langchain/prompts";
import {AgentExecutor, BaseSingleActionAgent, StoppingMethod } from "langchain/agents";
import { CallbackManagerForChainRun, Callbacks } from "langchain/callbacks";
import { BaseMultiActionAgent } from "langchain/dist/agents/agent";
import { BaseMemory } from "langchain/memory";
import { AgentAction, AgentFinish, ChainValues } from "langchain/schema";
import { Tool } from "langchain/tools";
@cwardzala
cwardzala / iubenda-react.js
Created February 28, 2020 18:21
React component to embed Iubenda privacy policy.
const Iubenda = ({
policyId
}) => {
useEffect(() => {
var s = document.createElement("script");
let tag = document.getElementsByTagName("script")[0];
s.src="https://cdn.iubenda.com/iubenda.js";
tag.parentNode.insertBefore(s,tag);
@ferstar
ferstar / code_highlight_addon.py
Last active April 8, 2018 15:09
fix an anki plugin bugs which was called "Syntax Highlighting for Code"
# -*- coding: utf-8 -*-
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import codecs
import os
import sys
from aqt import editor, addons, mw
@bmatcuk
bmatcuk / 1README.md
Created April 19, 2016 19:41
Sample html-brunch-static project using only handlebars

Sample html-brunch-static Project

This is a sample project that only uses the built-in handlebars processor. html-brunch-static supports many other options.

Running Locally

Copy these files locally into the following directory hierarchy:

test
├── app
@mcrider
mcrider / Gulpfile.js
Created May 21, 2015 19:40
Gulpfile for Apostrophe CMS -- Enables BrowserSync for live reloading (+ more) and compiles Sass into the main stylesheet
var gulp = require('gulp');
var nodemon = require('gulp-nodemon');
var jshint = require('gulp-jshint');
var concat = require('gulp-concat');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var notifier = require('node-notifier');
var uglify = require('gulp-uglify');
var sequence = require('run-sequence');
var util = require('gulp-util');
@stephenhardy
stephenhardy / git-clearHistory
Created April 26, 2013 22:14
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin [email protected]:<YOUR ACCOUNT>/<YOUR REPOS>.git