Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 | |
$array = [ | |
['tax'=>'1','val'=>10], | |
['tax'=>'1','val'=>20], | |
['tax'=>'2','val'=>10] | |
]; | |
$result = array_reduce($array,function($carry,$item){ | |
if(!isset($carry[$item['tax']])){ |
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
Alias /media/ /usr/local/var/www/mysite/media/ | |
# should run -> python manage.py collectstatic | |
Alias /static/ /usr/local/var/www/mysite/static/ | |
<Directory /usr/local/var/www/mysite/static> | |
Require all granted | |
</Directory> |
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
$( "#form-memberRegister" ).validate( { | |
errorClass: "error", | |
rules: { | |
"formatted-citizenID": { | |
required:true, | |
remote:{ | |
url: "action/checkCitizenID", | |
type: "post", | |
dataType:'json', | |
data: { |
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
# ต้องใช้ทุกบรรทัดไล่ลงไป | |
# git ignore wordpress but except themes-name | |
wordpress/* | |
!wordpress/wp-content | |
wordpress/wp-content/* | |
!wordpress/wp-content/themes | |
wordpress/wp-content/themes/* | |
!wordpress/wp-content/themes/twentyseventeen-child |
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
/** | |
* ปกติการ ใช้ registerJs("") ของ yii2 จะทำให้การเขียน script ค่อนข้างยาก | |
* ดังนั้นจึงเขียน javascript ในลักษณะนี้จะจัดการได้ง่ายกว่า ไม่ต้องคอยกังวลกับปัญหา "", '' | |
*/ | |
<script type="text/javascript"> | |
var obj = { | |
init:function(){ | |
$('#po-product_uom_qty').on('change',function(e){ | |
obj.calculateAmount(); | |
}); |
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 { Formik } from 'formik'; | |
import * as Yup from 'yup'; | |
class SignInScreen extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
username: null, | |
password: null, | |
rememberMe: false, |
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
SELECT * FROM _SYS_BIC."sap.db1.stock/InventoryTransactionDocumentsQuery"; |
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
ความแตกต่างระหว่าง docker run กับ docker exec | |
docker run | |
- docker run #{image} sh | |
- จะมีการสร้าง temporary container ขึ้นมาเพื่อรัน command เมื่อรันเสร็จจะหยุด container แต่ไม่ terminate | |
-- ดังนั้นจะมี container id ค้างอยู่ในระบบ | |
docker exec | |
- docker exec #{container} sh | |
- จะใช้ container ที่มีอยู่แล้วในการรัน |
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
dd.mm.yy | |
to excel date | |
=DATE("20"&RIGHT(B2,2),MID(B2,4,2),LEFT(B2,2)) |