Skip to content

Instantly share code, notes, and snippets.

View ambrizals's full-sized avatar
⌨️
Typing....

Ambrizal Suryadinata ambrizals

⌨️
Typing....
View GitHub Profile
error_log = C:\Server\nginx\logs\error.log
extension_dir = "ext"
extension=php_mbstring.dll
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_sqlite3.dll
sqlite3.extension_dir = ext
==================== SENDMAIL ====================
[mail function]
{!! Form::model($akun,['route' => ['Update Profil'], 'method' => 'PUT', 'files'=> true]) !!}
<div class="row">
<div class="col-4">
<img src="{{ url('/'.$fotoprofil) }}" alt="..." class="rounded-circle">
</div>
<div class="col-8">
{!! Form::label('fotoprofil', 'Foto Profil') !!}
<p>Catatan : Gunakan foto profil dengan ukuran gambar 150 x 150 pixel.</p>
{!! Form::file('fotoprofil', ['class' => 'form-control']) !!}
</div>
@ambrizals
ambrizals / AkunController.php
Last active August 27, 2017 02:16
AkunController : Part-Update
public function update(Request $request) {
$akunid = Auth::user()->id;
if ($request->hasFile('fotoprofil')) {
$fotoprofil = $request->file('fotoprofil');
$namafoto = 'profil-'.$akunid.'.'.$fotoprofil->getClientOriginalExtension();
$destinationPath = ('img/profil');
$ubah_foto = Image::make($fotoprofil->getRealPath())->resize(150,150);
$ubah_foto->save($destinationPath.'/'.$namafoto,80);
}else {
@ambrizals
ambrizals / Article.php
Last active September 5, 2017 11:19
Error : 2
public function CategoryArticle(){
return $this->belongsTo('App\CategoryArticle','kategori_article','id_category');
}
@ambrizals
ambrizals / EditBlog.vue
Created November 7, 2019 02:57
Code yang menggunakan form-data
updateArticle(){
this.updateCover = false
let formData = new FormData()
formData.append('cover_article', fs.createReadStream(this.imgCover.path))
axios.post('https://www.example.com/atk/posts/cover/'+this.params, formData, {
headers: {
'Access-Control-Allow-Origin': '*',
'Content-Type': 'multipart/form-data',
'Authorization' : 'Bearer ' + storageService.getToken()
}
@ambrizals
ambrizals / EditBlog.vue
Created November 7, 2019 02:49
Original Code
uploadCover() {
this.progressDialog = true
let formData = new FormData()
formData.append('cover_article', this.imgCover)
upload.post('atk/posts/cover/'+this.params, formData).then((res) => {
this.form.coverArticle = res.data
this.imgCover = null
this.progressDialog = false
this.updateCover = false
}).catch(() => {
@ambrizals
ambrizals / index.html
Created February 12, 2020 03:07
Automatic add id atribute to heading
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Document</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
@ambrizals
ambrizals / App.js
Created March 11, 2020 02:41
react-redux basic
import React from 'react';
import {NavigationContainer} from '@react-navigation/native';
import {createMaterialBottomTabNavigator} from '@react-navigation/material-bottom-tabs';
import FIcon from 'react-native-vector-icons/FontAwesome';
import homeScreen from './screen/Home';
import settingScreen from './screen/Settings';
import absenScreen from './screen/Absen';
import taskScreen from './screen/Task';
import {Provider} from 'react-redux';
import {createStore} from 'redux';
@ambrizals
ambrizals / index.html
Created April 2, 2020 15:17
Dotmatrix Simple Template 9,5 x 11 inch
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Print Dot Matrix Template 9.5 x 11</title>
</head>
<style>
@media print {
p,
@ambrizals
ambrizals / axios.js
Created April 18, 2020 08:31
Axios Class Function
import axios from 'axios';
import storageService from './storageService';
const isDevelopment = process.env.NODE_ENV !== "production";
export class httpService {
// Create Request Configuration