Skip to content

Instantly share code, notes, and snippets.

View chihebnabil's full-sized avatar

Nabil CHIHEB chihebnabil

View GitHub Profile

[

Text generation models

](/docs/guides/text-generation/text-generation-models)

New capabilities launched at DevDay

Text generation models are now capable of JSON mode and Reproducible outputs. We also launched the Assistants API to enable you to build agent-like experiences on top of our text-generation models. GPT-4 Turbo is available in preview by specifying gpt-4-1106-preview as the model name.

@chihebnabil
chihebnabil / Foo.php
Created April 21, 2020 17:27 — forked from h-collector/Foo.php
Standalone Laravel Queue + Redis example
<?php
namespace Jobs;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Redis\Database as Redis;
class Foo extends Job
{
use InteractsWithQueue;
@chihebnabil
chihebnabil / Foo.php
Created April 21, 2020 17:27 — forked from h-collector/Foo.php
Standalone Laravel Queue + Redis example
<?php
namespace Jobs;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Redis\Database as Redis;
class Foo extends Job
{
use InteractsWithQueue;
[
{
"productSize": "",
"item": "DELUXE COOKED HAM",
"plu_upc": "",
"price": " $5.15 ",
"productId": "102",
"catId": "1",
"uom": "LB"
},
package nabil.monjeuquiz.com.calculator;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
package net.simplifiedlearning.customlistviewandroid;
/**
* Created by Belal on 9/14/2017.
*/
public class Hero {
int image;
String name, team;
@chihebnabil
chihebnabil / paypal.js
Last active July 11, 2017 11:05
Paypal Fee Calculator
// Paypal Fee Calculator
// default sum
var sum = 100;
// default rate
feeRate = 0.049;
// default fee
fee = sum * feeRate + 0.3
// to get sum you need to demand to your client sum2
var sum2 = (0.3 + sum) / (1 - feeRate)
@chihebnabil
chihebnabil / script.js
Last active May 25, 2022 04:25
javascript : flat array to tree
var arr = [
{id: 1, title: 'hello', parent_id: 0},
{id: 2, title: 'hello', parent_id: 0},
{id: 3, title: 'hello', parent_id: 1},
{id: 4, title: 'hello', parent_id: 3},
{id: 5, title: 'hello', parent_id: 4},
{id: 6, title: 'hello', parent_id: 4},
{id: 7, title: 'hello', parent_id: 3},
{id: 8, title: 'hello', parent_id: 2}
];
<?php
$data['file'] = $_FILES;
$data['text'] = $_POST;
echo json_encode($data);
?>
$(function () {
$('#my_form').on('submit', function (e) {
// prevent browser from submitting the form
e.preventDefault();
var $form = $(this);
var formdata = (window.FormData) ? new FormData($form[0]) : null;
var data = (formdata !== null) ? formdata : $form.serialize();
$.ajax({