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, { Component } from "react"; | |
import Moment from "react-moment"; | |
import ReactTableContainer from "react-table-container"; | |
class DataTable extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
entities: { |
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\Http\Controllers; | |
use App\ProductStock; | |
use App\Http\Resources\ApiResource; | |
use Illuminate\Http\Request; | |
use Illuminate\Support\Facades\Validator; | |
use Illuminate\Database\Eloquent\Collection; |
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; | |
use Illuminate\Database\Eloquent\Model; | |
class ProductStock extends Model | |
{ | |
protected $table = "product_stock"; | |
protected $fillable = [ |
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
limit-memory-hard = 768 * your workers (e.g 4) *1024 * 1024 = 3221225472 | |
limit-memory-soft = 640 * your workers (e.g 4) *1024 * 1024 = 2684354560 |
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
Ternyata ada masalah di DNS lookup, dan tinggal ditambah skip-name-resolve di my.cnf/my.ini | |
[mysqld] | |
datadir=/var/lib/mysql | |
socket=/var/lib/mysql/mysql.sock | |
user=mysql | |
skip-name-resolve |
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
Melihat zona waktu yang digunakan dengan menggunakan perintah berikut: | |
perintah: | |
date | |
output: | |
root@localhost:~$ date | |
Sun Feb 15 14:16:23 UTC 2018 | |
Mengubah Zona Waktu di Linux Ke Indonesia | |
1. Backup dulu configurasi lama | |
sudo mv /etc/localtime /etc/localtime.old |
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
@api.multi | |
def remove_account(self): | |
to_removes = [ | |
['account.voucher.line', ], | |
['account.voucher', ], | |
['account.bank.statement.line', ], | |
['account.payment', ], | |
['account.analytic.line', ], | |
['account.analytic.account', ], | |
['account.invoice.line', ], |
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
Konfigurasi postgresql: | |
http://pgtune.leopard.in.ua/ | |
memory 4GB: | |
limit_memory_hard = 2684354560 | |
limit_memory_soft = 2147483648 | |
Custom setting | |
limit-memory-hard = 768 * your workers (e.g 4) *1024 * 1024 = 3221225472 | |
limit-memory-hard = 640 * your workers (e.g 4) *1024 * 1024 = 2684354560 |
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
@api.multi | |
def name_get(self): | |
result = [] | |
for record in self: | |
display_name = '[' + record.code + '] ' + record.name | |
result.append((record.id, display_name)) | |
return result |
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 datetime | |
def dow(date): | |
days=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"] | |
dayNumber=date.weekday() | |
print days[dayNumber] |
OlderNewer