This file contains 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 | |
// API's | |
Route::get('posts', 'PostController@index'); | |
Route::get('posts/{id}', 'PostController@show'); | |
Route::get('posts/search/{text}', 'PostController@search'); | |
Route::post('posts/store/now', 'PostController@store'); | |
Route::put('posts/{id}', 'PostController@update'); | |
Route::delete('posts/{id}', 'PostController@destroy'); | |
?> |
This file contains 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
<!------------- Blade Layout -----------> | |
@extends('layouts.app') | |
@section('content') | |
<div class="container"> | |
<test-component></test-component> | |
</div> | |
@endsection | |
<!-- Register Component --> |
This file contains 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, { Component } from 'react'; | |
import './App.css'; | |
class App extends Component { | |
constructor(props){ | |
super(props); | |
this.state = { | |
title: 'React Simple Todo App', | |
act: 0, |
This file contains 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
/********** Like.vue **********/ | |
<template> | |
<div class="like mt-3" v-cloak> | |
<span class="badge badge-primary">{{ like.length }} Like</span> | |
<span class="badge badge-danger">{{ unlike.length }} Unlike</span> | |
<span class="float-right" v-if="user"> | |
<button class="btn btn-primary" @click="likePost" v-if="canLike"><i class="fa fa-fw fa-thumbs-up" title="Like This Tutorial"></i></button> | |
<button class="btn btn-danger" @click="unlikePost" v-if="canUnlike"><i class="fa fa-fw fa-thumbs-down" title="Ublike This Tutorial"></i></button> | |
</span> | |
</div> |
This file contains 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
<html> | |
<head> | |
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> | |
<script src="https://d3js.org/d3.v5.min.js"></script> | |
</head> | |
<body> | |
<div class="container"> | |
<h4 class="text-center"> | |
Testing D3 |
This file contains 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
# Sales values of top 7 days | |
SELECT COUNT(id), created_at from transaction_sell_lines | |
WHERE product_id = 12601 | |
GROUP BY LEFT(created_at, 10) | |
ORDER BY count(id) DESC | |
LIMIT 7 |
This file contains 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
SELECT created_at, COUNT(created_at) | |
FROM `transactions` | |
WHERE type='opening_stock' | |
GROUP BY created_at | |
HAVING COUNT(created_at) > 1 |
This file contains 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 | |
// In Server 2 make a file download.php and then paste the code, | |
// here file_url means the server 1's zip file URL | |
// run/browse download.php like, | |
// http://domain_server2.com/download.php | |
file_put_contents("download.zip", fopen("file_url", 'r')); |
This file contains 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
SELECT pro.id, pro.name,pro.sku, sum(tsl.quantity) as totalSoldQty, LEFT(tsl.created_at, 10) as date | |
FROM products as pro | |
LEFT JOIN transaction_sell_lines tsl on tsl.product_id=pro.id | |
where sku=26017 and tsl.created_at between '2019-07-01' and '2019-08-30' | |
and pro.business_id=7 | |
GROUP BY LEFT(tsl.created_at, 10) |
This file contains 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
#For CPU and Memory utilizations: | |
htop | |
#View Server logs: | |
tail -f /var/log/mysql/error.log | |
tail -f /var/log/mysql/mysql.log | |
tail -f /var/log/mysql/mariadb-slow.log | |
# Open PHP.ini in Edit Mode | |
vi /etc/php/7.2/apache2/php.ini |