Skip to content

Instantly share code, notes, and snippets.

View josipjelic's full-sized avatar

Josip Jelić josipjelic

View GitHub Profile
@josipjelic
josipjelic / Report.php
Last active October 18, 2017 05:26
Laravel - Create report data placeholder array for certain period and merge it with collection from database
<?php
use Carbon\Carbon;
use DateInterval;
use DatePeriod;
use Illuminate\Support\Collection;
class Report
{
#!/usr/bin/env bash
echo "pre commit hook start"
CURRENT_DIRECTORY=`pwd`
PHP_CS_FIXER="$CURRENT_DIRECTORY/vendor/bin/php-cs-fixer"
HAS_PHP_CS_FIXER=false
@josipjelic
josipjelic / function-parse-video.php
Created October 29, 2015 22:37 — forked from AlexanderPoellmann/function-parse-video.php
A simple PHP function to parse a given string for a YouTube or Vimeo link (or embed code) and extract video ID, provider, etc.
<?php
/**
* Parse a video string
*
* @param string $haystack The string to be parsed
* @param string $protocol The protocol to be used for the urls
* @return array $video
*
* @version 2014-08-22
*