Skip to content

Instantly share code, notes, and snippets.

View thesubhendu's full-sized avatar

Subhendu Bhatta thesubhendu

View GitHub Profile
<?php
public function geoCodeLatLng($lat, $lng)
{
$googleGeocodeApiUrl=
"https://maps.googleapis.com/maps/api/geocode/json?latlng=$lat,$lng&key=".config('googlemapjs.key');
$response = json_decode(file_get_contents($googleGeocodeApiUrl));
if (!$response) {
@thesubhendu
thesubhendu / gitubuntusetup.txt
Created June 7, 2019 08:00
git detect changes after clone on ubuntu linux fix
//This worked:--
git config core.filemode false
//did not work
git config core.autocrlf input
@thesubhendu
thesubhendu / multi-step.blade.php
Created October 19, 2024 06:50
Multi step form ALpine js
<x-guest-layout>
<div x-data="jobApplication()" class="max-w-2xl mx-auto p-6">
<h2 class="text-2xl font-bold mb-6">Developer Job Application</h2>
<div x-show="Object.keys(errors).length > 0" class="mb-4 p-4 bg-red-100 border border-red-400 text-red-700 rounded">
<h4 class="font-bold mb-2">Please correct the following errors:</h4>
<ul class="list-disc list-inside">
<template x-for="(error, key) in errors" :key="key">
<li x-text="error[0]"></li>
</template>
@thesubhendu
thesubhendu / docs.md
Created November 1, 2024 10:55
AI-Driven Recommendation Engine in Laravel

Use cases:

Display matching jobs to applicants in Job websites, recommended videos , posts, products etc. One way to do it is using Sql queries which get difficult if there are too many parameters to consider. AI comes to rescue. Simplest way to build recommendation engine is using Vector embeddings .

Here I will use Open AI to generate embeddings, we can use other LLM models as well.

Todos

  • Laravel project with two models with data seeded applicants and Jobs
<?php
namespace Tests\Smoke;
use App\Models\EmailTemplate;
use App\Models\TemporaryPlacement;
use Illuminate\Support\Facades\Route;
use Tests\TestCase;
use App\Models\User;
use App\Models\Customer;