Skip to content

Instantly share code, notes, and snippets.

View bas080's full-sized avatar

#!/bin/BasH bas080

View GitHub Profile

$ cat ./README.md ./gpt | gpt Please update the README > README.md

Just kidding, I wrote the readme... or did I?

$ gpt

This Bash script uses the OpenAI API to generate a response to a user-specified query using the GPT-3 language model. The response is appended to a specified context file, which contains the history of messages and responses.

<template>
<slot v-scope="api" />
</template>
<script>
export default {
props: {
data: Function
},
<template>
<div>
<div v-for="item in items">
<slot v-slot="api(item)"/>
</div>
</div>
<!-- How to use
@bas080
bas080 / README.md
Last active January 24, 2022 14:51

Senior Backend Engineer Work Sample

The web-page for the task can be found [here][here].

Research

Data Integrity

The first questions I ask myself is how do we keep data integrity. I'm used to a sql database and I expect that MongoDB has (different) ways of realizing

#EXTM3U
#EXTINF:0, - Sup Doc: A Documentary Podcast | 167 - Watch Or Not Docs
https://dts.podtrac.com/redirect.mp3/chtbl.com/track/2ED44/rss.art19.com/episodes/89788572-5866-47e7-8b2c-a794976a39ce.mp3
#EXTINF:0, - Intercepted with Jeremy Scahill | The Life and Death of an Anti-Fascist
https://sphinx.acast.com/intercepted-with-jeremy-scahill/thelifeanddeathofananti-fascist/media.mp3
#EXTINF:0, - Pretend - a true crime documentary podcast | S705: The Word of Faith Fellowship Update
https://pdst.fm/e/traffic.megaphone.fm/ADV3247937134.mp3?updated=1614638622
#EXTINF:0, - The Daily Stoic | Author Ron Lieber on Money and Values
https://www.buzzsprout.com/202128/8055688-author-ron-lieber-on-money-and-values.mp3?blob_id=36208009
#EXTINF:0, - SUBTEXT Literature and Film Podcast | Business Gets Personal in “The Godfather”
function scan(fn, list, result = []) {
if (list.length < 2)
return result
const [a, b, ...rest] = list
return scan(fn, [b, ...rest], [...result, fn(a, b)])
}
const assert = require('assert')
class Playlist {
constructor(items) {
this.__items = items
this.__index = 0
}
isLastItem() {
#!/usr/bin/env stack
-- stack --resolver lts-6.25 script
import Data.Ratio
type Currency = (String, Ratio Integer)
type Value = (Currency, Ratio Integer)
convert :: Value -> Currency -> Value
convert ((_, a), amount) (currency, b) = ((currency, b), (amount * a) * b)
@bas080
bas080 / weeks_since_epoch.sql
Created March 4, 2019 23:53
Weeks since epoch
-- Depending on what you sonsider the start of the week, you can either subtract 3 or 2 days. The week in which the epoch occured is the 0 week.
select CEIL(EXTRACT(DAYS FROM (('1970-01-04'::timestamp - '1970-01-01') - (INTERVAL '3 days'))) / 7);
function rejections(promises) {
let failed = []
return Promise.all(promises.map(promise =>
promise.catch(err => {
failed = [err, ...failed]
return err
}))