Skip to content

Instantly share code, notes, and snippets.

View vtvz's full-sized avatar
🦊
What does DevOps say

Vitaly Zaslavsky vtvz

🦊
What does DevOps say
View GitHub Profile
@vtvz
vtvz / index.js
Created November 9, 2023 20:24
OpenAI Lyrics Analysis
#!/bin/env node
// Use the openai package from npm to call ChatGPT
import OpenAI from "openai";
import fs from "fs";
// Create a new instance of the openai client with our API key
const openai = new OpenAI({
apiKey: process.env.OPENAI_KEY,
});
@vtvz
vtvz / example.php
Last active January 6, 2018 10:39
stream_select with rabbitmq example
<?php
/*
Some code here
More info here (Russian): https://www.facebook.com/vtvz.ru/posts/1612858868772444
*/
$stdin = fopen('php://stdin', 'r');
$rabbitmq = $connection->getSocket();
while (count($channel->callbacks)) {
$read = [$rabbitmq, $stdin];
<?php
class Collection
{
/** @var Item[] */
protected $items;
/**
* Collection constructor.
* @param Item $main
* @param Item[] $items