Skip to content

Instantly share code, notes, and snippets.

Running with a big smile

Ido Green greenido

Running with a big smile
View GitHub Profile
greenido / openai-simple-text-translation-call.js
Created March 20, 2023 18:13
An openai API example of using the DaVinci engine for language translation
View openai-simple-text-translation-call.js
const axios = require('axios');
const API_KEY = 'your_api_key_here';
const API_URL = '';
async function translateText(text, targetLanguage) {
const response = await`${API_URL}engines/davinci/translate`, {
target_language: targetLanguage,
}, {
headers: {
greenido / openai-simple-image-recongnition-call.js
Created March 20, 2023 18:12
An example on how to leverage OpenAI API for image recognition
View openai-simple-image-recongnition-call.js
const axios = require('axios');
const API_KEY = 'your_api_key_here';
const API_URL = '';
async function recognizeImage(image_url) {
// We are passing in a URL of an image as data and making a POST
// request to the OpenAI API, and the response will contain information
// about what is in the picture.
greenido / openai-simple-text-call.js
Created March 20, 2023 18:10
OpenAI simple text call
View openai-simple-text-call.js
const axios = require('axios');
// You should use dotenv - but for the easy of use I put it here.
const API_KEY = 'your_api_key_here';
const API_URL = '';
const prompt = 'how can I bake a good bread?';
async function generateText(prompt) {
  const response = await`${API_URL}engines/davinci-codex/completions`, {
greenido / openai-simple-call.js
Created March 19, 2023 23:35
A simple call to openai API
View openai-simple-call.js
const { Configuration, OpenAIApi } = require("openai");
async function main() {
const configuration = new Configuration({
apiKey: process.env.OPENAI_API_KEY,
const openai = new OpenAIApi(configuration);
const completion = await openai.createCompletion({
greenido / adventofcode_com_2022_day_21_part1.js
Created December 21, 2022 20:46
The monkeys are back! You're worried they're going to try to steal your stuff again, but it seems like they're just holding their ground and making various monkey noises at you. Eventually, one of the elephants realizes you don't speak monkey and comes over to interpret. As it turns out, they overheard you talking about trying to find the grove;…
View adventofcode_com_2022_day_21_part1.js
// Author: @greenido
// Date: 21-Dec-2022
const fs = require('fs')
const monkeys = new Map();
greenido /
Created December 15, 2022 01:15
Best TV Shows 2022

Illustration by Andrew B. Myers

Television felt big in 2022—not just in the number of shows that débuted (a staggering legion, no doubt) but in the spectacle on display. This was especially apparent in the I.P.-amped fantasy realm. “The Lord of the Rings: The Rings of Power,” on Amazon Prime Video, earned the dubious distinction of becoming the most expensive series ever made, with a production budget reportedly topping a billion dollars. Its closest rival, HBO’s “House of the Dragon,” featured too many flying lizards to count, and threatened to resuscitate the monoculture that was eulogized alongside “Game of Thrones.” Meanwhile, the “Star Wars” series “Andor,” on Disney+, made planet-hopping akin to boarding a rocket-propelled Greyhound bus.

It’s unclear how much longer TV will stay bulky and bloated; Wall Street’s souring on streaming in the past several months portends a contraction in the entertainment industry that’s already begun, with the shelving of some films and the whittling down of on-demand

View skymass-analyst-ui-1.js
import { SkyMass } from "@skymass/skymass";
const sm = new SkyMass({ key: "XXX" });"/hello_world", (ui) => {
const name = ui.string("name", {
label: "Please type your name",
});`Hello, ${name.val || "World"}!`);

Keybase proof

I hereby claim:

  • I am greenido on github.
  • I am greenido ( on keybase.
  • I have a public key ASAxT8jI-pWizVOfT8zsrWDVvYzkgcTzriKZEDsiel5KJQo

To claim this, I am signing this object:

greenido /
Last active May 16, 2021 23:46
Some of the best games out there are free and could be used with friends and family.


Name Why you should play it? Online version Comments
Settlers Of Catan Negotiation and trading – fun fun fun Free/Paid.My favorite.
Among Us A classic from the NRiB OGs Free.A Fun one with co-workers as well.
Draw battle Show your super power drawing skills Free Great production value, variety of modes, easy drop in/drop out Paid
Poker Tons of clients out there! Would probably work best as directly advertised poker game night. Black Tie not required but encouraged Many more options
Escape Room There’s a few self-run online escape rooms that I’ve annecdotally heard are quite fun (better than some chaperoned virtual escape rooms) Many options – Google will help hereHere is one example Free/Paid.A great way to learn about your friends…
# -*- coding: utf-8 -*-
import json,sys
import urllib.request as urllib2
coin_ticker = "BTC" if "BTC"[0] != "{" else "BTC"
fiat_ticker = "USD" if "USD"[0] != "{" else "USD"
fiat_symbol = "$" if "$"[0] != "{" else "$"
num_format = "{:0,.1f}" if "{:0,.1f}"[2:8] != "format" else "{}"
mod_percent = float("0") if "0"[0] != "{" else float(0)