This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" $@ | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(() => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.ghx-controls-filters, .ghx-qty, .ghx-issue-fields .ghx-key, .ghx-card-footer .ghx-type, .ghx-card-footer .ghx-flags, .ghx-card-footer .ghx-end, .ghx-card-footer .ghx-days, #announcement-banner { | |
display: none!important; | |
} | |
#ghx-pool-column { | |
padding: 0 20px; | |
} | |
.ghx-issue .ghx-highlighted-fields .ghx-highlighted-field { | |
max-width: none; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function trackClick(name) { | |
if (!name) throw "track needs a name"; | |
ga.track(name); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def calculate_character_probability(character, questions_so_far, answers_so_far): | |
# Prior | |
P_character = 1 / len(characters) | |
# Likelihood | |
P_answers_given_character = 1 | |
P_answers_given_not_character = 1 | |
for question, answer in zip(questions_so_far, answers_so_far): | |
P_answers_given_character *= max( | |
1 - abs(answer - character_answer(character, question)), 0.01) |
NewerOlder