This file contains code snippets to be used while following the Angular 2 with Webpack Project Setup video tutorial.
You can find the full project in the angular2-course-webpack-starter repository.
<!DOCTYPE html>
This file contains code snippets to be used while following the Angular 2 with Webpack Project Setup video tutorial.
You can find the full project in the angular2-course-webpack-starter repository.
<!DOCTYPE html>
-- phpMyAdmin SQL Dump | |
-- version 4.5.1 | |
-- http://www.phpmyadmin.net | |
-- | |
-- Host: 127.0.0.1 | |
-- Generation Time: May 28, 2016 at 08:16 AM | |
-- Server version: 10.1.9-MariaDB | |
-- PHP Version: 5.6.15 | |
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; |
<?php | |
//Intervention Image Package: | |
//http://image.intervention.io | |
Route::get('generate', function(){ | |
$text = 'image/jpg'; | |
$width = 1600; | |
$height = 1000; | |
$centerH = $width/2; |
Validator::extend('youtube', function ($attribute, $value, $parameters, $validator) { | |
return preg_match("/(youtube.com|youtu.be)\/(watch)?(\?v=)?(\S+)?/", $value); | |
}, "Sorry, this doesn't look like a valid youtube URL"); |
// Make sure to put this at the top of your AppServiceProvider: use Illuminate\Support\Facades\Validator; | |
Validator::extend('youtube', function ($attribute, $value, $parameters, $validator) { | |
preg_match("#(?<=v=)[a-zA-Z0-9-]+(?=&)|(?<=v\/)[^&\n]+(?=\?)|(?<=v=)[^&\n]+|(?<=youtu.be/)[^&\n]+#", $value, $matches); | |
return count($matches) > 0; | |
}, "Sorry, this doesn't look like a valid youtube URL"); |
var Sequelize = require('sequelize') | |
var sequelize = new Sequelize('sequelize_test', 'root') | |
//Note that the model definition does not have "fullName" | |
var User = sequelize.define('User', { | |
email: Sequelize.STRING, | |
firstName: Sequelize.STRING, | |
lastName: Sequelize.STRING, | |
}, | |
{ |
// Custom Validator to add errors into vuex store and also handle laravel form errors. | |
import { mapGetters } from 'vuex'; | |
import { CLEAR_FORM_ERRORS, ERROR } from '../vuex/types'; | |
import Vue from 'vue'; | |
export default { | |
data() { | |
return { | |
errors: [], | |
keepServerErrors: ['unique', 'boolean', 'exists', 'regular_chars', 'identifier', 'date'], |
<?php | |
/** | |
* Easy PDO for PHP 5.x | |
* Version 1.2 | |
* | |
* Copyright (c) 2009-2014 Kijin Sung <kijin@kijinsung.com> | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal |
<?php namespace App\Exceptions; | |
use Log; | |
use Mail; | |
use Config; | |
use Exception; | |
use Illuminate\Auth\Access\UnauthorizedException; | |
use Illuminate\Session\TokenMismatchException; | |
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; |
<?php | |
class Encoding { | |
protected static $win1252ToUtf8 = array( | |
128 => "\xe2\x82\xac", | |
130 => "\xe2\x80\x9a", | |
131 => "\xc6\x92", | |
132 => "\xe2\x80\x9e", |