Last Message ID: 89569
Andrew M. Webb on Twitter |
---|
"""You help triaging user requests. Given a raw text input, output either DOCS or DEFAULT, according to those definitions: | |
DOCS: if user is asking a seemingly technical question, programming questions or company-specific questions | |
DEFAULT: if user is just chit-chatting or basic knowledge questions | |
==================== | |
Input: hello there | |
Output: DEFAULT |
# This is how langchain chain composition looks with a more FP approach | |
import re | |
from typing import ( | |
Literal, | |
TypedDict, | |
cast, | |
) | |
from dotenv import load_dotenv |
# Convert video to gif | |
ffmpeg -i input.mp4 -filter_complex "[0]fps=10" output.gif | |
ffmpeg -ss 00:00:00.000 -i newtab.mov -pix_fmt rgb24 -r 10 output.gif | |
convert -verbose -dither none -matte -depth 8 -deconstruct -layers optimizePlus -colors 32 output.gif optimized.gif | |
# Convert mkv to mp4 | |
ffmpeg -i input.mkv -codec copy output.mp4 |
Last Message ID: 89569
Andrew M. Webb on Twitter |
---|
# Usage: | |
# post '{"name": "Mr Foo"}' https://myapi/register | |
# | |
post () { | |
local json="$1"; | |
local url="$2"; | |
shift 2; | |
curl -X POST -H "Content-Type: application/json" --data "$json" "$url" $@ | |
} |
#if 0 | |
#include <SPI.h> | |
#include <PN532_SPI.h> | |
#include <PN532.h> | |
#include <NfcAdapter.h> | |
PN532_SPI pn532spi(SPI, 10); | |
NfcAdapter nfc = NfcAdapter(pn532spi); | |
#else |
const { merge, interval, from, Observable, Subject, zip } = Rx; | |
const { delay, partition, tap, take, bufferTime, bufferWhen, map, bufferCount, mergeMap, concatAll, windowCount, buffer, mergeAll, filter } = RxOperators; | |
const topic$ = new Subject(); | |
const retryTopics = [1,2,3,4,5,6,7,8,9,10].map(i => | |
delay(1000 * 2 ** i)(new Subject()) | |
); | |
let i = 0; | |
setInterval(() => { |
def deinspect(str, level=0) | |
str.gsub!(/:0x0[^ ]+/, '') | |
matches = str.match(/<([\w:]+) (.*)>/) | |
return str unless matches | |
head = matches[1] | |
body = matches[2] | |
hash_content = nil |
const thiagoWay = (lista) => { | |
let ar = lista.map((el) => el.name); | |
let array_elements = ar.sort(); | |
let current = null; | |
let cnt = 0; | |
for (var i = 0; i < array_elements.length; i++) { | |
delete lista[i].id; | |
if (array_elements[i] != current) { |
const NOT_ASKED = 'NOT_ASKED'; | |
const LOADING = 'LOADING'; | |
const SUCCESS = 'SUCCESS'; | |
const ERROR = 'ERROR'; | |
export const notAsked = () => ({ state: NOT_ASKED }); | |
export const loading = () => ({ state: LOADING }); | |
export const success = result => ({ state: SUCCESS, result }); | |
export const error = message => ({ state: ERROR, message }); |