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
<?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']])){ |
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
[ | |
'attribute'=>'in_date', | |
'format'=>['date', 'dd/MM/yyyy'], //format นี้จะใช้ในการแสดง | |
'filterType'=>GridView::FILTER_DATE, | |
'filterWidgetOptions'=>[ | |
'type' => DatePicker::TYPE_COMPONENT_APPEND, | |
'pluginOptions' => [ | |
'autoclose'=>true, | |
'format' => 'yyyy-mm-dd' //format นี้จะใช้ใน Query statement | |
] |
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
[ | |
'attribute'=>'lot_id', | |
'value'=>'lot.name', | |
'label'=>'Control No.', | |
'filterType'=> GridView::FILTER_SELECT2, | |
'filterWidgetOptions'=>[ | |
'initValueText'=>'hello', | |
'options' => ['placeholder' => 'Search for a city ...'], | |
'pluginOptions' => [ | |
'allowClear' => true, |
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
order_line_id = self.models.execute_kw(self.db, self.uid, self.password, 'purchase.order.line', 'create', | |
[{'order_id': opo_id, | |
'partner_id':partner_id, | |
'name': product['name'], | |
'product': product, | |
'product_qty': xpo_line['ordqty'], | |
'price_unit': xpo_line['unitpr'], | |
'date_planned':rcvdat, | |
'taxes_id':[(6,False,[tax_id])], | |
}]) |
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
let url:NSURL = NSBundle.mainBundle().URLForResource("howto", withExtension: "html", subdirectory: "local_html")! | |
self.webViewDialog.loadRequest(NSURLRequest(URL: url)) |
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
func animateView3(view:UIView){ | |
let animation:CABasicAnimation = CABasicAnimation(keyPath: "backgroundColor") | |
animation.fromValue = FlatWhite().CGColor | |
animation.toValue = FlatYellowDark().CGColor | |
animation.duration = 0.5 | |
//animation.autoreverses = true | |
view.layer.addAnimation(animation, forKey: "backgroundColor") | |
} |
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
[button setTranslatesAutoresizingMaskIntoConstraints: NO]; | |
id topGuide = myViewController.topLayoutGuide; | |
NSDictionary *viewsDictionary = NSDictionaryOfVariableBindings (button, topGuide); | |
[myViewController.view addConstraints: | |
[NSLayoutConstraint constraintsWithVisualFormat: @"V:[topGuide]-20-[button]" | |
options: 0 | |
metrics: nil | |
views: viewsDictionary] | |
]; |
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
UIBlurEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark]; | |
UIVisualEffectView *bluredView = [[UIVisualEffectView alloc] initWithEffect:effect]; | |
bluredView.frame = self.view.bounds; | |
[self.view insertSubview:bluredView atIndex:0]; |