Download Flutter SDK, extract the "Flutter" folder and put somewhere on your machine https://flutter.dev/docs/get-started/install
Add path for 'location/flutter/bin'
Download Flutter SDK, extract the "Flutter" folder and put somewhere on your machine https://flutter.dev/docs/get-started/install
Add path for 'location/flutter/bin'
<?php | |
//Intervention Image Package: | |
//http://image.intervention.io | |
Route::get('generate', function(){ | |
$text = 'image/jpg'; | |
$width = 1600; | |
$height = 1000; | |
$centerH = $width/2; |
export const isSameURL = (a, b) => a.split('?')[0] === b.split('?')[0] | |
export const isRelativeURL = u => | |
u && u.length && /^\/[a-zA-Z0-9@\-%_~][/a-zA-Z0-9@\-%_~]*[?]?([^#]*)#?([^#]*)$/.test(u) | |
export default function ({ app }) { | |
const redirect = function (name, noRouter = false) { | |
if (!this.options.redirect) { | |
return | |
} |
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"); |
// 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 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; |
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works | |
const axios = require('axios'); // promised based requests - like fetch() | |
function getCoffee() { | |
return new Promise(resolve => { | |
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee | |
}); | |
} |
<?php | |
function html_table($data = array()) | |
{ | |
$rows = array(); | |
foreach ($data as $row) { | |
$cells = array(); | |
foreach ($row as $cell) { | |
$cells[] = "<td>{$cell}</td>"; | |
} |
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>