public function updated(Order $order)
{
$originals = [];
if ($order->isDirty('order_status')) {
Log::info("order new status :" . $order->order_status . " -- old status :" . $order->getOriginal('order_status'));
}
foreach ($order->getDirty() as $key => $val) {
$originals[$key] = $order->getOriginal($key);
}
This file contains 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
function random_color() | |
{ | |
$colors = ['red', 'yellow', 'aqua', 'blue', 'light-blue', 'green', 'navy', 'teal', 'olive', | |
'orange', 'fuchsia', 'purple', 'maroon', 'black', 'red-active', 'yellow-active', 'aqua-active', | |
'blue-active', 'light-blue-active', 'green-active', 'navy-active', 'teal-active', 'olive-active', | |
'orange-active', 'fuchsia-active', 'purple-active', 'maroon-active', 'black-active',]; | |
return Arr::random($colors); | |
} |
This file contains 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
# 默认窗口无标题栏,16:9的窗口比例启动 | |
window: | |
# decorations: "none" | |
# dimensions: | |
# columns: 120 | |
# lines: 30 | |
startup_mode: Maximized | |
# 背景半透明,方便抄代码 | |
background_opacity: 0.9 |
This file contains 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
/** | |
* ArcUtils.java | |
* | |
* Copyright (c) 2014 BioWink GmbH. | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
import hashlib
def file_md5(fname):
hash_md5 = hashlib.md5()
with open(fname, "rb") as f:
for chunk in iter(lambda: f.read(4096), b""):
hash_md5.update(chunk)
return hash_md5.hexdigest()
This file contains 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
#!/bin/sh | |
echo Install all AppStore Apps at first! | |
# no solution to automate AppStore installs | |
read -p "Press any key to continue... " -n1 -s | |
echo '\n' | |
echo Install and Set San Francisco as System Font | |
ruby -e "$(curl -fsSL https://raw.github.com/wellsriley/YosemiteSanFranciscoFont/master/install)" | |
echo Install Homebrew, Postgres, wget and cask | |
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" |
This file contains 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
/usr/bin/plutil -convert xml1 -o - ~/Library/Safari/Bookmarks.plist | grep -E -o '<string>http[s]{0,1}://.*</string>' | grep -v icloud | sed -E 's/<\/{0,1}string>//g' |
exiftool "-CreateDate<FileModifyDate" "-DateTimeOriginal<FileModifyDate" "-ModifyDate<FileModifyDate" -overwrite_original .
pip install -U git+https://github.com/shadowsocks/shadowsocks.git@master
This file contains 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
[ | |
/*============= Emacs Style =============*/ | |
{ "keys": ["ctrl+b"], "command": "move", "args": {"by": "characters", "forward": false} }, | |
{ "keys": ["ctrl+f"], "command": "move", "args": {"by": "characters", "forward": true} }, | |
{ "keys": ["ctrl+p"], "command": "move", "args": {"by": "lines", "forward": | |
false} }, | |
{ "keys": ["ctrl+n"], "command": "move", "args": {"by": "lines", "forward": | |
true} }, | |
{ "keys": ["ctrl+a"], "command": "move_to", "args": {"to": "bol", "extend": false} }, | |
{ "keys": ["ctrl+e"], "command": "move_to", "args": {"to": "eol", "extend": false} }, |
NewerOlder