Skip to content

Instantly share code, notes, and snippets.

View ryanmortier's full-sized avatar

Ryan Mortier ryanmortier

View GitHub Profile
@lagbox
lagbox / AppServiceProvider.php
Last active January 29, 2016 21:36
Extending ResourceRegistrar to allow for 'singular' wildcards and wildcard renaming.
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
// ...
let webpack = require("webpack");
mix.webpackConfig({
plugins: [
// Choose the language you want to keep (Ex: "fr")
new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /fr/)
]
});
<?php
namespace App\Providers;
use App\Permission;
use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
class AuthServiceProvider extends ServiceProvider
{
@laracasts
laracasts / Alert.vue
Created March 15, 2016 02:36
Alert .vue example.
<template>
<div class="Alert Alert--{{ type | capitalize }}">
<slot></slot>
</div>
</template>
<script>
export default {
props: {
type: {
@ShahinSorkh
ShahinSorkh / .php_cs
Last active September 17, 2020 13:38
php-cs-fixer config to follow laravel style guides
<?php
$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->name('*.php')
->notName('_ide_helper.php')
->notName('*.blade.php')
->notPath('bootstrap')
->notPath('node_modules')
->notPath('storage')

Adrian -

I appreciate that you spent time in writing this post. I know I've been up until 2am writing similarly long ones as well. I will take responsibility for having what is likely an irrational response (I blame Twitter for that) to the term "NoOps", but I invite you to investigate why that might be. I'm certainly not the only one who feels this way, apparently, and thus far have decided this issue is easily the largest distraction in my field I've encountered in recent years. I have had the option to simply ignore my opposition to the term, and just let the chips fall where they may with how popular the term "NoOps" may or may not get. I have obviously not taken that option in the past, but I plan to in the future.

You're not an analyst saying "NoOps". Analysts are easy (for me) to ignore, because they're not practitioners. We have expectations of engineering maturity from practitioners in this field of web engineering, especially those we consider leaders. I don't have any expectations from analysts,

Real-time Grid Component with Laravel, Vue.js, Vuex & Socket.io (Google Docs-like Functionality)

Motivation

The exercise of writing this tutorial -- as well as recording it as a screencast -- has helped me better understand the concepts behind a couple of my favorite open source tools. Both the tutorial and screencast will be of personal use in the future as references. If they are of help to others, that will be great too.

I love Google Docs' real-time, multi-user interactive capability, and I've have always been a fan of spreadsheets. I wanted to see if I could replicate that type of functionality. What I've done is taken the basic Vue.js Grid Component example and altered it a bit so that when a user clicks on a cell, that cell becomes highlighted or "active", not just in the user's browser but in any browser instance cur

@isuzuki
isuzuki / .php_cs
Last active September 26, 2022 19:58
Config for PHP-CS-Fixer ver 2 (based on laravel .php_cs https://github.com/laravel/framework/blob/5.4/.php_cs)
<?php
/**
* Config for PHP-CS-Fixer ver2
*/
$rules = [
'@PSR2' => true,
// addtional rules
# Thanks to this post:
# http://blog.ikato.com/post/15675823000/how-to-install-consolas-font-on-mac-os-x
$ brew install cabextract
$ cd ~/Downloads
$ mkdir consolas
$ cd consolas
$ curl -O http://download.microsoft.com/download/f/5/a/f5a3df76-d856-4a61-a6bd-722f52a5be26/PowerPointViewer.exe
$ cabextract PowerPointViewer.exe
$ cabextract ppviewer.cab
@tristar500
tristar500 / String to Float.php
Created December 7, 2013 22:52
Convert string value with commas into a float
$val = "1,234,988.56";
$num = floatval(str_replace(",","",$val));
echo $num;
// returns - 1234988.56