Skip to content

Instantly share code, notes, and snippets.

Avatar

Simon Depelchin depsimon

View GitHub Profile
@depsimon
depsimon / UserFactory.php
Created Jul 18, 2019
Unique initials from first name & last name in Laravel Model Factory
View UserFactory.php
<?php
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use App\User;
use Illuminate\Support\Str;
use Faker\Generator as Faker;
/*
|--------------------------------------------------------------------------
| Model Factories
@depsimon
depsimon / profile.vue
Created Mar 5, 2019
Vuetify Profile Page
View profile.vue
<template>
<v-container fluid>
<v-layout column>
<v-card>
<v-card-text>
<v-flex class="mb-4">
<v-avatar size="96" class="mr-4">
<img :src="'/avatars/avatar_' + (form.avatar.toLowerCase()) + '.png'" alt="Avatar">
</v-avatar>
<v-btn @click="openAvatarPicker">Change Avatar</v-btn>
@depsimon
depsimon / AvatarPicker.vue
Created Mar 5, 2019
Avatar Picker with Vuetify in a Profile Form
View AvatarPicker.vue
<template>
<v-dialog :fullscreen="$vuetify.breakpoint.xs" width="500" transition="dialog-bottom-transition" v-model="show">
<v-card>
<v-toolbar dark color="primary">
<v-btn icon dark @click="show = false">
<v-icon>close</v-icon>
</v-btn>
<v-toolbar-title>Select an Avatar</v-toolbar-title>
<v-spacer></v-spacer>
</v-toolbar>
@depsimon
depsimon / RouteSummaryCommand.php
Created Jul 13, 2018
route:summary Summary of all registered routes
View RouteSummaryCommand.php
<?php
namespace App\Console;
use Illuminate\Foundation\Console\RouteListCommand;
use Illuminate\Routing\Route;
use Symfony\Component\Console\Input\InputOption;
class RouteSummaryCommand extends RouteListCommand
{
@depsimon
depsimon / Icon.vue
Last active Apr 15, 2018
Font Awesome 5 - SVG Icon component
View Icon.vue
<template>
<svg class="icon" viewBox="0 0 512 512"><use :xlink:href="'/svg/fa-' + w + '.svg#' + n"></use></svg>
</template>
<script>
export default {
props: {
weight: { default: 'regular' },
name: { type: String }
},
View genesis_public_key
04ea926c2a9244bbf9b0ccafa7bc7037a4d5872a609baec1259b6ad2d793eded1c578947b1030a67a05f3f16bad16818357b16d6ac46edfb68ead3ae66db36457e;frbayart
@depsimon
depsimon / helpers.php
Created Jan 27, 2018
Count mondays of a month with Carbon in PHP/Laravel
View helpers.php
<?php
function mondaysInMonth($month = null) {
if ($month === null) $month = Carbon\Carbon::today()->startOfMonth();
$nextMonth = $month->copy()->endOfMonth();
return $month->diffInDaysFiltered(function ($date) {
return $date->isMonday();
}, $nextMonth);
@depsimon
depsimon / bulma.blade.php
Created Jul 16, 2017
Laravel Bulma Pagination Template
View bulma.blade.php
@if ($paginator->hasPages())
<nav class="pagination">
{{-- Previous Page Link --}}
@if ($paginator->onFirstPage())
<a class="pagination-previous" disabled>Previous</li>
@else
<a class="pagination-previous" href="{{ $paginator->previousPageUrl() }}" rel="prev">Previous</a>
@endif
{{-- Next Page Link --}}
@depsimon
depsimon / helper.php
Created Dec 9, 2014
PHPExcel - CSV to array helper function
View helper.php
<?php
/**
* Helper function to convert CSV sheet to key value array
* PHPExcel.php class required
* @param string $filePath path to CSV file
* @param string $delimiter delimiter
* @param string $enclosure enclosure
* @param string $lineEnding line ending
* @param integer $sheetIndex sheet index to read
@depsimon
depsimon / css_resources.md
Created Jun 2, 2014 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.
View css_resources.md

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

You can’t perform that action at this time.