Skip to content

Instantly share code, notes, and snippets.

View febridev's full-sized avatar
💭
Learning Some Data Engineer

febriyant abidin febridev

💭
Learning Some Data Engineer
View GitHub Profile
@febridev
febridev / eloquent-cheatsheet.php
Created August 11, 2016 08:20 — forked from hassansin/eloquent-cheatsheet.php
Laravel 5 Eloquent CheatSheet #laravel #eloquent
Model::
/*Select*/
select('col1','col2')
->select(array('col1','col2'))
->select(DB::raw('businesses.*, COUNT(reviews.id) as no_of_ratings, IFNULL(sum(reviews.score),0) as rating'))
->addSelect('col3','col4')
->distinct() // distinct select
/*From*/
@febridev
febridev / PostController.php
Created October 14, 2016 02:28 — forked from franquis/PostController.php
Summernote image upload with PHP (Laravel + Intervention\lmage)
<?php
/**
* This exemple shows how to parse base64 encoded images (submitted using Summernote), save them locally
* and replace the 'src' attribute in the submited HTML content
*
**/
use Intervention\Image\ImageManagerStatic as Image;
class PostController {
public function edit(){
@febridev
febridev / Error Limit Upload PHP.ini
Created October 17, 2016 02:59
Error Limit Upload PHP.ini
#laravel Message Error
PHP Warning: POST Content-Length of 11933650 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
#Source Solution
-- http://stackoverflow.com/questions/2184513/php-change-the-maximum-upload-file-size
-- http://stackoverflow.com/questions/6279897/post-content-length-exceeds-the-limit
@febridev
febridev / app\Exceptions\Handler.php
Created October 25, 2016 03:58
set custom not found page (success in laravel 5.3)
...
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
/**
* Render an exception into a response.
*
* @param \Illuminate\Http\Request $request
@febridev
febridev / README.md
Created October 27, 2016 04:00 — forked from jxson/README.md
README.md template

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation

@febridev
febridev / README-Template.md
Created October 27, 2016 04:00 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@febridev
febridev / app\Http\routes.php
Created November 3, 2016 04:16
Flash Message Can't Show Because Middleware Group's
//fixed by replace
Route::group(['middleware' => ['web']], function () {
...
});
//with
Route::group(['middlewareGroups' => ['web']], function () {
...
});
@febridev
febridev / my.cnf
Last active November 29, 2016 08:59
Setup MySQL Log
step1: Go to this file(/etc/mysql/conf.d/mysqld_safe_syslog.cnf) and remove or comment those line.
step2: Go to mysql conf file(/etc/mysql/my.cnf ) and add following lines
To enable error log add following
[mysqld_safe]
log_error=/var/log/mysql/mysql_error.log
[mysqld]
@febridev
febridev / backup_db.bat
Last active February 8, 2017 09:42
Batch mysqldump.exe backup_database
##locate this file on xampp/mysql/bin
##and create Task Schedule on Your Windows
mysqldump.exe --user=yourUser --password=yourPassword --host=localhost --port=3306 --result-file="D:\winorcl\dump.sql" --all-databases
@febridev
febridev / iframe.html
Created March 21, 2017 13:44
scroll off google maps
<!DOCTYPE html>
<html>
<head>
<style>
.scrolloff {
pointer-events: none;
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>