Skip to content

Instantly share code, notes, and snippets.

View revolunet's full-sized avatar
🐫
Killing bugz

Julien Bouquillon revolunet

🐫
Killing bugz
View GitHub Profile
@sgomez
sgomez / main.ts
Last active September 22, 2024 10:28
Telegram bot with Vercel SDK AI and ollama provider
import dotenv from "dotenv";
import { Telegraf } from "telegraf";
import { message } from "telegraf/filters";
import process from "node:process";
import { ollama } from "ollama-ai-provider";
import { generateText, type CoreMessage, type StreamTextResult } from "ai";
dotenv.config();
@qjoly
qjoly / COSIGN.MD
Last active August 18, 2024 22:50

I have many Docker images to maintain (mostly personal projects) but I have no way of verifying the authenticity of my images. To add an extra layer of security, I decided to POC the use of Cosign.

There are many alternatives, but some require the maintenance of a key management server or are just less popular than Cosign.

Requirements

Generate a cosign signature

Comment utiliser Matomo sans bannière de consentement

  1. permettre aux visiteurs de refuser d’être suivis (Opt-out) (exemple)
  2. désactiver les cookies (par l'usage de disableCookies ou via l'admin de Matomo)
  3. anonymiser les IP : anonymiser au moins 2 octets via l’admin de Matomo
  4. anonymiser le référent via l’admin de Matomo
  5. exclure les données personnelles des URL et titre des pages
  6. exclure les données personnelles des variables personnalisées, dimensions, évènements (usage avancé)
  7. *masquer les données personnelles dans le
@jrknox1977
jrknox1977 / ollama_dspy.py
Created February 9, 2024 18:06
ollama+DSPy using OpenAI APIs.
# install DSPy: pip install dspy
import dspy
# Ollam is now compatible with OpenAI APIs
#
# To get this to work you must include `model_type='chat'` in the `dspy.OpenAI` call.
# If you do not include this you will get an error.
#
# I have also found that `stop='\n\n'` is required to get the model to stop generating text after the ansewr is complete.
# At least with mistral.
@younesbelkada
younesbelkada / finetune_llama_v2.py
Last active February 18, 2025 18:02
Fine tune Llama v2 models on Guanaco Dataset
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@kylemcdonald
kylemcdonald / function-calling.ipynb
Created June 14, 2023 01:10
Example of OpenAI function calling API to extract data from LAPD newsroom articles.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@josephrocca
josephrocca / resize-and-center-crop.js
Last active April 17, 2023 16:10
Center crop and bicubic/bilinear/lanczos resize image in JavaScript (using wasm-vips)
// Put this in your HTML to load the `Vips` global: <script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/vips.js"></script>
const vips = await Vips();
async function resizeAndCenterCrop(blob, resizeType="cubic", size=224) {
// resize types available: cubic, linear, lanczos2, lanczos3, nearest, mitchell
let im1 = vips.Image.newFromBuffer(await blob.arrayBuffer());
// Resize so smallest side is `size` px:
const scale = 224 / Math.min(im1.height, im1.width);
@joelonsql
joelonsql / PostgreSQL-EXTENSIONs.md
Last active March 29, 2025 16:53
1000+ PostgreSQL EXTENSIONs

🗺🐘 1000+ PostgreSQL EXTENSIONs

This is a list of URLs to PostgreSQL EXTENSION repos, listed in alphabetical order of parent repo, with active forks listed under each parent.

⭐️ >= 10 stars
⭐️⭐️ >= 100 stars
⭐️⭐️⭐️ >= 1000 stars
Numbers of stars might not be up-to-date.

@sebasjm
sebasjm / package.json
Last active December 19, 2024 19:20
preact cli into single html file
{
"name": "preact single html",
"version": "1.0.0",
"description": "",
"scripts": {
"build-single": "preact build --no-sw --no-esm -c preact.single-config.js --dest single && sh remove-link-stylesheet.sh",
},
"keywords": [],
"author": "",
"license": "ISC"
@degitgitagitya
degitgitagitya / .env
Last active March 17, 2025 09:27
Next JS + Next Auth + Keycloak + AutoRefreshToken
# KEYCLOAK BASE URL
KEYCLOAK_BASE_URL=
# KEYCLOAK CLIENT SECRET
KEYCLOAK_CLIENT_SECRET=
# KEYCLOAK CLIENT ID
KEYCLOAK_CLIENT_ID=
# BASE URL FOR NEXT AUTH