Skip to content

Instantly share code, notes, and snippets.

View ivanvermeyen's full-sized avatar
🇧🇪
Never stop learning!

Ivan Vermeyen ivanvermeyen

🇧🇪
Never stop learning!
View GitHub Profile
@michaeldyrynda
michaeldyrynda / Envoy.blade.php
Last active March 25, 2016 02:43
Laravel 4 Envoy deploy configuration
@servers([ 'remote' => 'server.example.com'])
@setup
if ( ! isset($repo) )
{
throw new Exception('--repo must be specified');
}
if ( ! isset($base_dir) )
{
@juukie
juukie / macro.php
Created November 7, 2017 08:02
Laravel social media url macro
<?php
URL::macro('social', function ($name, $replacement = '#') {
return array_get([
'facebook' => 'https://www.facebook.com/mypage/',
'instagram' => 'https://www.instagram.com/mypage/',
'pinterest' => 'https://nl.pinterest.com/mypage/',
], $name), $replacement);
});
@jeffochoa
jeffochoa / RouterServiceProvider.php
Created July 30, 2017 20:28
Get collection of available routes in Laravel
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Route;
use Illuminate\Routing\Route as Router;
class RouterServiceProvider extends ServiceProvider
{
@ivanvermeyen
ivanvermeyen / Vessel.md
Last active December 19, 2018 11:32
Docker Project Setup with Vessel
@calebporzio
calebporzio / webpack.mix.js
Created March 2, 2019 15:17
A webpack.mix.js file for writing NPM packages the way you write JS in a Laravel app.
let mix = require('laravel-mix');
mix.js('src/index.js', 'dist/foo.js').sourceMaps();
mix.webpackConfig({
output: {
libraryTarget: 'umd',
}
})
@wwdboer
wwdboer / gist:4943672
Created February 13, 2013 10:27
PHP: Get Vimeo ID
function get_vimeoid( $url ) {
$regex = '~
# Match Vimeo link and embed code
(?:<iframe [^>]*src=")? # If iframe match up to first quote of src
(?: # Group vimeo url
https?:\/\/ # Either http or https
(?:[\w]+\.)* # Optional subdomains
vimeo\.com # Match vimeo.com
(?:[\/\w]*\/videos?)? # Optional video sub directory this handles groups links also
\/ # Slash before Id
@kaphert
kaphert / ViewAssertions.php
Created September 14, 2018 23:04
Assert that blade view files are loaded with PHPUnit in Laravel
/**
* Laravel + PHPUnit assert that blade files are being loaded.
*
* Trait AssertView
*/
trait ViewAssertions
{
protected $__loadedViews;
protected function captureLoadedViews()
<?php
$rbls = [
'b.barracudacentral.org',
'cbl.abuseat.org',
'http.dnsbl.sorbs.net',
'misc.dnsbl.sorbs.net',
'socks.dnsbl.sorbs.net',
'web.dnsbl.sorbs.net',
'dnsbl-1.uceprotect.net',
@JeffreyWay
JeffreyWay / .bash_profile
Created July 31, 2015 19:20
Prettier git logs
alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
@taylorotwell
taylorotwell / tenant-middleware
Created December 1, 2015 03:07
Magical tenant middleware thing
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Auth\Access\AuthorizationException;
class VerifyTenants
{
/**