Skip to content

Instantly share code, notes, and snippets.

@lukepolo
lukepolo / Error.js
Last active February 28, 2017 16:00
Helper Classes for Vue.js / Vuex / Vue-Router
//https://github.com/laracasts/Vue-Forms/blob/master/public/js/app.js
class Errors {
/**
* Create a new Errors instance.
*/
constructor() {
this.errors = {};
}
<script>
import Form from '../../../libraries/form.js';
export default {
created() {
if ( !Object.keys(this.$store.getters.businesses).length )
this.$store.dispatch('getBusinesses')
},
data() {
return {
// inside boot()
resolve(EngineManager::class)->extend('elasticsearch', function () {
return new ElasticsearchEngine(ClientBuilder::fromConfig(config('scout.elasticsearch.config')), config('scout.elasticsearch.index'));
});
router.afterEach((to, from) => {
(function(i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function() {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
@lukepolo
lukepolo / UserStore.js
Last active November 5, 2018 21:09
Vuex Sample - read filename inside of the file
// store/modules/user/UserStore.js
export default {
state: {
user: user,
},
actions: {
getCurrentUser : ({commit}) => {
Vue.http.get(Vue.action('User\UserController@index')).then((response) => {
commit('SET_USER', response.data);
}, (errors) => {
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Models\NotificationProvider;
use App\Models\RepositoryProvider;
use App\Models\Server\Provider\ServerProvider;
use App\Models\User\User;
use App\Models\User\UserLoginProvider;
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateUserProvidersTable extends Migration
{
/**
* Run the migrations.
*
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
<?php
use Geocoder\Model\Coordinates;
use GuzzleHttp\Client as HttpClient;
/**
* Class GeoLocation
*/
class GeoLocation implements Contracts\GeoLocation
cat > /etc/apt/apt.conf.d/50unattended-upgrades << EOF
Unattended-Upgrade::Allowed-Origins {
"Ubuntu xenial-security";
};
Unattended-Upgrade::Package-Blacklist {
//
};
EOF
cat > /etc/apt/apt.conf.d/10periodic << EOF