Skip to content

Instantly share code, notes, and snippets.

View cygeorgel's full-sized avatar

Cyrille Georgel cygeorgel

View GitHub Profile
/**
* @param string $direction
* @return array
*/
public function lineFormat($direction = 'credit'): array
{
return [
0 => [
'element' => 'INT_TYP',
'length' => 1,
@cygeorgel
cygeorgel / mobileGridToBlueRockTELKeys.txt
Last active January 29, 2022 17:26
Mobile grid to BlueRockTEL keys
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
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
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)
<script>
// function checkTypeCount() {
//
// $(".type").change(function () {
// let type = $(this).val();
//
// let typeCount = 0;
//
// if (type=='m') {
// typeCount = 10;
<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
<?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
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;
public function store(Request $request)
{
//app('log')->debug(request()->all());
$body = "body-html";
$body = $request->$body;
if (! $body) {
$body = '';
}
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);