Skip to content

Instantly share code, notes, and snippets.

Avatar

Cyrille Georgel cygeorgel

View GitHub Profile
@cygeorgel
cygeorgel / mobileGridToBlueRockTELKeys.txt
Last active January 29, 2022 17:26
Mobile grid to BlueRockTEL keys
View mobileGridToBlueRockTELKeys.txt
public function map()
{
return [
/**
* line 4:
*/
4 => [
1 => ['grid_name'],
],
@cygeorgel
cygeorgel / gist:7c65052719efe057cd46acbb857f2895
Created September 16, 2021 10:08
Check cconflicts for time spans
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 September 16, 2021 10:06
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 March 1, 2021 08:18
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;
@cygeorgel
cygeorgel / gist:c0cc8ad13eea1fd8d321a0deac428ee6
Created February 20, 2021 10:00
Simple info about running streak
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);