Skip to content

Instantly share code, notes, and snippets.

View opejovic's full-sized avatar
:octocat:
Work in progress

ognjen opejovic

:octocat:
Work in progress
View GitHub Profile
<?php
namespace App\Utilities\Filters;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Http\Request;
class ActivityOnly implements Filter
{
/**
@opejovic
opejovic / readme.md
Last active September 13, 2020 08:18
How ti install Vue in new Laravel 8 application
  1. run npm install --save vue

  2. Add the following to your resources/js/app.js:

     window.Vue = require('vue');
     Vue.component('example-component', require('./components/ExampleComponent.vue').default);
     const app = new Vue({
       el: '#app',
     });
    
  3. Create an ExampleComponent.vue in the resources/js/components directory

@opejovic
opejovic / animated-placeholder-three.scss
Created April 25, 2020 12:11
Animated placeholder sample 3.
.animated-placeholder {
background: linear-gradient(
90deg,
#eef2f6,
#eef4fa,
#ffffff,
#eef4fa,
#eef2f6
);
background-size: 600% 600%;
@opejovic
opejovic / shine-animation.scss
Created April 24, 2020 22:19
Shimmer / shine placeholder animation css.
.shine {
background: #f6f7f8;
background-image: linear-gradient(
to right,
#f6f7f8 0%,
#edeef1 20%,
#f6f7f8 40%,
#f6f7f8 100%
);
background-repeat: no-repeat;
.animated-placeholder-two {
background: linear-gradient(90deg, #eef2f6, #eef4fa, #ffffff, #eef4fa, #eef2f6);
background-size: 600% 600%;
-webkit-animation: left-to-right 2.5s ease-out infinite;
-moz-animation: left-to-right 2.5s ease-out infinite;
animation: left-to-right 2.5s ease-out infinite;
}
@-webkit-keyframes left-to-right {
.animated-placeholder {
background: linear-gradient(-90deg, #eef2f6, #ffffff, #bcbfc3);
background-size: 400% 400%;
-webkit-animation: left-to-right 3s ease infinite;
-moz-animation: left-to-right 3s ease infinite;
animation: left-to-right 3s ease infinite;
}
@-webkit-keyframes left-to-right {
@opejovic
opejovic / CSVParser.php
Last active December 28, 2019 19:33
CSVParser - parses data from csv files. The transformed data that it returns is stored in MySQL.
<?php
namespace App\Helpers;
use App\Models\Practice;
use Illuminate\Support\Facades\Storage;
class CsvParser
{
private $file;
<?php
namespace App\Utilities;
use Carbon\Carbon;
use App\ApiRequest;
use Illuminate\Pagination\LengthAwarePaginator;
trait PreparesApiActivityData
{
<template>
<div class="small">
<div v-if="datacollection !== null">
<!-- Stat cards -->
<div class="row justify-content-center">
<div class="col-md-2 m-1">
<div
class="statcard statcard-primary statcard-shadow px-2 py-1"
>
<h5 class="statcard-number">
@opejovic
opejovic / Paginator.vue
Created November 27, 2019 20:44
TailwindCSS and Vue paginator with Laravel backend
<template>
<div class="flex items-center" v-if="paginationExists()">
<!-- previous -->
<div class="cursor-pointer" @click="prev()">
<svg class="w-4 h-4 text-gray-600 fill-current" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/>
</svg>
</div>
<!-- pages -->