This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Exceptions; | |
| use Exception; | |
| use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; | |
| use Illuminate\Http\Response; | |
| use Symfony\Component\HttpKernel\Exception\HttpException; | |
| use Illuminate\Database\Eloquent\ModelNotFoundException; | |
| use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- phpMyAdmin SQL Dump | |
| -- version 4.7.7 | |
| -- https://www.phpmyadmin.net/ | |
| -- | |
| -- Host: mysql | |
| -- Generation Time: Jul 26, 2018 at 07:44 AM | |
| -- Server version: 5.7.21 | |
| -- PHP Version: 7.1.9 | |
| SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Check { | |
| constructor(value) { | |
| this.value = value | |
| this.result = false | |
| } | |
| match(pattern) { | |
| const patterns = { | |
| alpha: /^[a-z\s]+$/i, | |
| alnum: /^[a-z0-9\s]+$/i, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react' | |
| const getUsers = async (callback) => { | |
| // call api | |
| // dummy response | |
| const response = { | |
| status: 'success', | |
| message: 'get data user success', | |
| data: [ | |
| {id: 1, name: 'AAA'}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| find . \( -iname "*.jpg" -o -iname "*.png" \) -print0 | \ | |
| while read -d $'\0' -r image; do | |
| convert $image -resize '500>' $image; | |
| read w h < <(sips -g pixelWidth -g pixelHeight "$image" | \ | |
| awk '/Width:/{w=$2} /Height:/{h=$2} END{print w " " h}') | |
| echo $image $w $h | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const express = require('express') | |
| const bodyParser = require('body-parser') | |
| const methodOverride = require('method-override') | |
| const app = express() | |
| app.use(bodyParser.urlencoded({ limit: '50mb', extended: true })) | |
| app.use(bodyParser.json({limit: '50mb'})) | |
| app.use(methodOverride()) | |
| app.use((err, req, res, next) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react' | |
| import { useHistory, useParams } from 'react-router-dom' | |
| import Axios from 'axios' | |
| const getProduct = async (productId, callback) => { | |
| try { | |
| const response = await Axios.get(`http://localhost:3000/product/${productId}`) | |
| console.log(response) | |
| callback(response.data) | |
| } catch (error) { |