Skip to content

Instantly share code, notes, and snippets.

from langchain.llms import Anthropic
from langchain.agents import load_tools, initialize_agent
from langchain.tools import AIPluginTool
PREFIX = """\n\nHuman: Answer the following questions as best you can. You have access to the following tools:"""
SUFFIX = """Begin!
Question: {input}
\n\nAssistant:
Thought:{agent_scratchpad}"""
@danharper
danharper / x.sh
Created June 16, 2016 15:46
building an ionic/cordova android app on ubuntu. actually using circle, but needed to test something out on a fresh box
# starting with a Ubuntu 14 box on AWS
# increase swap
# https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04
sudo fallocate -l 4G /swapfile
ls -lh /swapfile
sudo chmod 600 /swapfile
ls -lh /swapfile
sudo mkswap /swapfile
@egel
egel / audio_extensions
Created April 15, 2015 20:07
Big group of extensions (audio, text)
.caf Core Audio File 4.5 stars
.abm Music Album 4.5 stars
.oga Ogg Vorbis Audio File
.omf Open Media Framework File
.pla Sansa Playlist File
.asd Ableton Live Sample Analysis File
.bnk Adlib Instrument Bank
.bun Cakewalk Bundle File
.csh Cubase Waveform File
.hsb HALion Sound Bank File
@voxpelli
voxpelli / SASS_Color_Contrast.md
Last active August 21, 2022 11:49
Pure SASS script for calculating contrast ratios of colors. MOVED TO: https://github.com/voxpelli/sass-color-helpers

Pure SASS-adaption of Lea Verou's contrast-ratio javascript. Can be useful when eg. generating colored buttons from a single supplied color as you can then check which out of a couple of text colors would give the best contrast.

This script currently lacks the support for alpha-transparency that Lea supports in her script though.

In addition to the color-contrast adaption there's also some math methods that were needed to be able to calculate the exponent of a number and especially so when the exponent is a decimal number. A 2.4 exponent is used to calculate the luminance of a color and calculating such a thing is not something that SASS supports out of the box and not something I found a good pure-SASS script for calculating and I much prefer pure-SASS over ruby extensions. The math methods might perhaps be unecessary though if you're running Compass or similar as they may provide compatible math methods themselves.

Normal usage: `color: pick_best_color(#f00

@heartcode
heartcode / mixins.css.scss
Created November 9, 2012 11:09
SASS mixins
@mixin background_image ($filename) {
background-image: image-url(1x/#{$filename});
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (-o-min-device-pixel-ratio: 3/2),
only screen and (min--moz-device-pixel-ratio: 1.5),
only screen and (min-device-pixel-ratio: 1.5) {
background-image: image-url(2x/#{$filename});
}
}
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';