Skip to content

Instantly share code, notes, and snippets.

@pitzcarraldo
pitzcarraldo / README.md
Last active October 1, 2024 08:06
continue.dev config.json free edition

continue.dev config.json free edition

Purpose

Continue.dev itself is already free and open-sourced. However, to use it, you'll need API keys to access various providers, many of which are paid services.

While you can run models locally using Ollama, doing so requires a powerful machine with a GPU, which typically comes at a high cost. Additionally, models that can be run locally with ease typically have fewer parameters and are lighter, resulting in lower performance compared to API-provided models.

Fortunately, Google Gemini offers free quotas if you agree to allow the use of your usage data. Additionally, Mistral provides free Codestral API access, which can be used for auto-completion.

@pitzcarraldo
pitzcarraldo / cf-cache.ts
Last active January 23, 2024 09:17
example to use cf cache
async function handleRequest(
c: any,
args: any
): Promise<any> {
const cacheKey = new URL(c.req.url).toString();
const cachedResponse = await caches.default.match(cacheKey);
if (cachedResponse) {
return c.json(await cachedResponse.json());
}
@pitzcarraldo
pitzcarraldo / alias_yarn.sh
Created October 13, 2016 07:07
Way to use yarn more familiar and easy.
#!/bin/sh
# OSX
ln -s /usr/local/bin/yarn /usr/local/bin/ypm
@pitzcarraldo
pitzcarraldo / event-loop-nashorn.js
Created January 28, 2016 14:50 — forked from bripkens/event-loop-nashorn.js
Java 8 Nashorn event loop "polyfill". javax.script.ScriptEngine#eval calls should immediately call window.main to enter the event loop and thus to avoid concurrency issues. The XMLHttpRequest simulation is not yet finished.
(function(context) {
'use strict';
var Timer = Java.type('java.util.Timer');
var Phaser = Java.type('java.util.concurrent.Phaser');
var TimeUnit = Java.type('java.util.concurrent.TimeUnit');
var AsyncHttpClient = Java.type('com.ning.http.client.AsyncHttpClient');
var timer = new Timer('jsEventLoop', false);
var phaser = new Phaser();
@pitzcarraldo
pitzcarraldo / RatioCalculator.java
Created October 21, 2015 00:39
MAB(Multi-Armed Bandits) Java Implementation
/**
* @descreption Calculate impression ratio for Arms by ArmStatistics.
* @author Minkyu Cho([email protected])
* The logic of this class is based on R code in below article(Figure 4).
* http://mktg455cnu.net/wp-content/uploads/2014/10/scott.pdf
*/
@Slf4j
@Component
public class RatioCalculator {
private static final int SIMULATE_COUNT_BASE = 100;