Skip to content

Instantly share code, notes, and snippets.

View khubo's full-sized avatar
👻
punemployed!

Aswin khubo

👻
punemployed!
  • Internet
View GitHub Profile
import fetch from 'node-fetch';
import mongoose from 'mongoose';
import { config } from 'dotenv';
config();
const HF_TOKEN = process.env.HF_TOKEN;
const EMBEDDING_URI = process.env.EMBEDDING_URI;
// uses the hugging face api to generate embeddings.
let root = [
{
id: 'd090544e-5d2c-11ee-8c99-0242ac120002',
industry: 'random',
name: 'Value Diagnostics',
subSections: {
type: 'root',
items: [
{
id: 'b749e3a9-fc44-4eda-80d8-e0cd91d7e0ca',
@khubo
khubo / timer.go
Created September 26, 2023 15:35
package main
import (
"time"
"github.com/rivo/tview"
)
var app = tview.NewApplication()
var view = tview.NewModal().SetText("00:00:00")
apiVersion: v1
kind: Service
metadata:
name: knote
spec:
selector:
app: knote
ports:
- port: 80
targetPort: 3000

Developers love (talking about) open source. The popularity of GitHub, the infinite number of modules in package registries, and open source projects are all indicators of this. I, myself, have contributed and tried to contribute to, Open-source projects. I believe that's how the world is supposed to work. Humans should share knowledge and collectively build stuff, enabling each other.

It seems developers aren't the only ones in love with Open source though. From baby startups to conglomerates, every other company is dying to show their love for OSS these days. Some of these are the same companies that have more patent lawyers than developers or have been busy bashing open source a while ago. I bet they didn't suddenly turn into socialists or something. I can think of two reasons.

Exploitation

For most companies, open-source is free labor. Many of the most popular modules in almost all popular languages are being written and maintained by some developers in their free time. Companies that use the

@khubo
khubo / error.sh
Created August 3, 2021 02:34
installation error
error: linking with `cc` failed: exit status: 1
|
= note: "cc" "-arch" "arm64" "/var/folders/n5/zksxdqdx1jxdmgntyyf0nhj00000gn/T/cargo-installVzuf3t/release/deps/wasm_pack-246ee7616e3e77fa.wasm_pack.dzyhpnt1-cgu.0.rcgu.o" "/var/folders/n5/zksxdqdx1jxdmgntyyf0nhj00000gn/T/cargo-installVzuf3t/release/deps/wasm_pack-246ee7616e3e77fa.wasm_pack.dzyhpnt1-cgu.1.rcgu.o" "/var/folders/n5/zksxdqdx1jxdmgntyyf0nhj00000gn/T/cargo-installVzuf3t/release/deps/wasm_pack-246ee7616e3e77fa.wasm_pack.dzyhpnt1-cgu.10.rcgu.o" "/var/folders/n5/zksxdqdx1jxdmgntyyf0nhj00000gn/T/cargo-installVzuf3t/release/deps/wasm_pack-246ee7616e3e77fa.wasm_pack.dzyhpnt1-cgu.11.rcgu.o" "/var/folders/n5/zksxdqdx1jxdmgntyyf0nhj00000gn/T/cargo-installVzuf3t/release/deps/wasm_pack-246ee7616e3e77fa.wasm_pack.dzyhpnt1-cgu.12.rcgu.o" "/var/folders/n5/zksxdqdx1jxdmgntyyf0nhj00000gn/T/cargo-installVzuf3t/release/deps/wasm_pack-246ee7616e3e77fa.wasm_pack.dzyhpnt1-cgu.13.rcgu.o" "/var/folders/n5/zksxdqdx1jxdmgntyyf0nhj00000gn/T/cargo-installVzuf3t/release/d
import util from "util";
/**
* parses basic arithmetic expressions
* GRAMMAR:
* <expression> ::= <term> { (MINUS|PLUS) <term> }*
* <term> ::= <factor> { {MULT|DIV} <factor> }*
* <factor> ::= <number> | ( <expression> )
*/
let allMessages = [];
function updateMessage() {
let jobQueue = [];
let running = false;
return function(message) {
// whenever the function gets called push the message to a job queue.
jobQueue.push(message);
if(!running) {
// react hook (from the react-cabal-client)
function useMessage(messageLimit,) {
const {cabalClient} = useContext(CabalProvider);
const [messages, setMessages] = useState(cabalClient.getMessage(messageLimit));
useEffect() {
cabalClient.subscribe(updateMessages)
{"variables":{"filter":{"organization_id":{"eq":"b5fe2b68-9c21-4307-a7d2-af191a28f8e5"},"or":[{"name":{"contains":"helloworld"}},{"name":{"contains":"Helloworld"}},{"name":{"contains":"hElloworld"}},{"name":{"contains":"HElloworld"}},{"name":{"contains":"heLloworld"}},{"name":{"contains":"HeLloworld"}},{"name":{"contains":"hELloworld"}},{"name":{"contains":"HELloworld"}},{"name":{"contains":"helLoworld"}},{"name":{"contains":"HelLoworld"}},{"name":{"contains":"hElLoworld"}},{"name":{"contains":"HElLoworld"}},{"name":{"contains":"heLLoworld"}},{"name":{"contains":"HeLLoworld"}},{"name":{"contains":"hELLoworld"}},{"name":{"contains":"HELLoworld"}},{"name":{"contains":"hellOworld"}},{"name":{"contains":"HellOworld"}},{"name":{"contains":"hEllOworld"}},{"name":{"contains":"HEllOworld"}},{"name":{"contains":"heLlOworld"}},{"name":{"contains":"HeLlOworld"}},{"name":{"contains":"hELlOworld"}},{"name":{"contains":"HELlOworld"}},{"name":{"contains":"helLOworld"}},{"name":{"contains":"HelLOworld"}},{"name":{"contains":