Skip to content

Instantly share code, notes, and snippets.

response = OPENAI_CLIENT.chat(
parameters: {
model: "gpt-4-0613", # Required.
messages: [
{ role: "system", content: "Tu es un expert en aviation et OSINT. Je vais te donner des données ADS-B que tu vas interpréter afin de déterminer le type de vol ou de mission dont il s'agit. Utilise uniquement la fonction sortie."},
{ role: "user", content: self.traces.last.to_json }
],
functions: [
{
name: "sortie",
$(function() {
/*
// TABS
*/
$('body').on('click', '.w-tab-link', function(e) {
// Set to active the selected tab link
var selected = $(this).attr('data-w-tab')
$(this).closest('.w-tab-menu').find('.w-tab-link').removeClass('w--current')
$(this).addClass('w--current')
@berpj
berpj / db_clean.rake
Last active February 20, 2019 16:16
# lib/tasks/db_clean.rake
# Homemade rake task to clean DB for Rails 5
namespace :db do
desc "Reset and seed DB"
task :clean => :environment do
# Empty tables and reset primary id autoincrement
ApplicationRecord.connection.tables.each do |table|
next if table.match(/\Aschema_migrations\Z/) || table.match(/\Aar_internal_metadata\Z/)
ApplicationRecord.connection.execute("TRUNCATE TABLE #{table} RESTART IDENTITY CASCADE")

Keybase proof

I hereby claim:

  • I am berpj on github.
  • I am berpj (https://keybase.io/berpj) on keybase.
  • I have a public key ASCfuc2xEtlc92znUEcJYFv7EVWJU5oEAyxkSHUHmMyDugo

To claim this, I am signing this object:

t = gets.strip.to_i
t.times do
count = 0
x = gets.strip.split.map(&:to_i)
y = Math.sqrt(x[0]).floor
z = Math.sqrt(x[1]).floor
count += 1 if y**2 == x[0]
y += 1
while (y**2 <= x[1]) do
count += 1
@berpj
berpj / forward.py
Created February 3, 2016 22:54 — forked from samim23/forward.py
# "Colorizing B/W Movies with Neural Nets",
# Network/Code Created by Ryan Dahl, hacked by samim.io to work with movies
# BACKGROUND: http://tinyclouds.org/colorize/
# DEMO: https://www.youtube.com/watch?v=_MJU8VK2PI4
# USAGE:
# 1. Download TensorFlow model from: http://tinyclouds.org/colorize/
# 2. Use FFMPEG or such to extract frames from video.
# 3. Make sure your images are 224x224 pixels dimension. You can use imagemagicks "mogrify", here some useful commands:
# mogrify -resize 224x224 *.jpg
# mogrify -gravity center -background black -extent 224x224 *.jpg
@berpj
berpj / s3-tmp-link.rb
Last active August 29, 2015 14:14
Create a temporary S3 link