Skip to content

Instantly share code, notes, and snippets.

Avatar

Cyrille Georgel cygeorgel

View GitHub Profile
View gist:7c65052719efe057cd46acbb857f2895
private function checkConflicts(array $daysOfWeek, array $timeSpan, $callQueueId, $callQueueTimeSpanId = null)
{
$conflicts = 0;
if ($callQueueTimeSpanId) {
foreach ($daysOfWeek as $dayOfWeek) {
$conflicts += CallQueueTimeSpan::where('call_group_id', $callQueueId)
->where('id', '!=', $callQueueTimeSpanId)
@cygeorgel
cygeorgel / gist:38b37d7520426a9b98647e7923210646
Created Sep 16, 2021
Check conflicts for time span groups
View gist:38b37d7520426a9b98647e7923210646
private function checkConflicts(array $daysOfWeek, array $timeSpan, $callQueueGroupId, $callQueueGroupTimeSpanId = null)
{
$conflicts = 0;
if ($callQueueGroupTimeSpanId) {
foreach ($daysOfWeek as $dayOfWeek) {
$conflicts += CallQueueGroupTimeSpan::where('call_queue_group_id', $callQueueGroupId)
->where('id', '!=', $callQueueGroupeTimeSpanId)
View gist:61e98162771a6efbef9d7ee22d510198
<script>
// function checkTypeCount() {
//
// $(".type").change(function () {
// let type = $(this).val();
//
// let typeCount = 0;
//
// if (type=='m') {
// typeCount = 10;
View gist:56e3723091068cfa2404c7997cc87620
<div id="accordion" class="accordion mt-3">
<div class="card mt-1">
<div class="card-header" id="headingOne" data-toggle="collapse" data-target="#collapseOne" aria-expanded="false" aria-controls="collapseOne">
<h5 class="mb-0">
<button class="btn btn-link collapsed" type="button">
Title 1
</button>
</h5>
</div>
<div id="collapseOne" class="collapse" aria-labelledby="headingOne" data-parent="#accordion">
@cygeorgel
cygeorgel / ovhClick2Call
Last active Mar 1, 2021
OVH Click 2 Call
View ovhClick2Call
<?php
namespace App\Http\Controllers;
use App\ConfigOvh;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Session;
use Ovh\Api;
View gist:c0cc8ad13eea1fd8d321a0deac428ee6
public function handle()
{
// I get manually the data from Strava
$start = '2020-04-25';
$data['2020']['mileage'] = 2183.5;
$data['2020']['time'] = 231;
$data['2021']['mileage'] = 526.5;
$data['2021']['time'] = 49;
$mileage = 0;
View ApiIncomingMailController.php
public function store(Request $request)
{
//app('log')->debug(request()->all());
$body = "body-html";
$body = $request->$body;
if (! $body) {
$body = '';
}
View Import.php
class Import
{
public function prospects()
{
$file = 'axonaut/prospects.csv';
if (Storage::disk('ftp')->exists($file)) {
$data = Storage::disk('ftp')->get($file);
$lines = explode("\n", $data);
View Jours fériés France
public function nextWorkingDay(Carbon $date)
{
$holidays = [];
$holidays[] = Carbon::create($date->format('Y'), 1, 1);
$holidays[] = Carbon::create($date->format('Y'), 5, 1);
$holidays[] = Carbon::create($date->format('Y'), 5, 8);
$holidays[] = Carbon::create($date->format('Y'), 7, 14);
$holidays[] = Carbon::create($date->format('Y'), 8, 15);
$holidays[] = Carbon::create($date->format('Y'), 11, 1);
$holidays[] = Carbon::create($date->format('Y'), 11, 11);
View GenericController.php
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class NewsletterListController extends Controller
{
public function __construct()
{