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
public struct TextSize { | |
fileprivate struct CacheEntry: Hashable { | |
let text: String | |
let font: UIFont | |
let width: CGFloat | |
let insets: UIEdgeInsets | |
fileprivate var hashValue: Int { | |
return text.hashValue ^ Int(width) ^ Int(insets.top) ^ Int(insets.left) ^ Int(insets.bottom) ^ Int(insets.right) |
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
//=====定義Enum===== | |
enum MyListType: Int, CustomStringConvertible, EnumCaseCountable { | |
case waitingForReceive | |
case overseaReceived | |
case shipmentNotified | |
case notifyTransferPay | |
case transferPayChecked | |
case overseaShipped | |
case shipmentDone |
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
[program:APP_NAME] | |
command=vapor run --env=production | |
directory=/home/USER_NAME/YOUR_APP/ # Put correct path here | |
autorestart=true | |
user=USER_NAME # Put username here | |
stdout_logfile=/var/log/supervisor/%(program_name)-stdout.log | |
stderr_logfile=/var/log/supervisor/%(program_name)-stderr.log |
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
server { | |
server_name YOUR_DOMAIN_NAME; | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
root /home/YOUR_VAPOR_FOLDER_PATH/Public; | |
index index.html; | |
try_files $uri @proxy; | |
location @proxy { |
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
eval "$(curl -sL https://apt.vapor.sh)" | |
sudo apt-get install swift vapor | |
sudo apt-get install libpq-devcd |
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
sudo su | |
apt-get update | |
apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y && apt-get install htop -y | |
apt-get install unattended-upgrades -y && dpkg-reconfigure -plow unattended-upgrades | |
apt-get install ntp -y && ntpq -p && service ntp restart | |
reboot |
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
desc "Deploy a new version to the App Store" | |
lane :release do | |
# 1.Creating Certificates and Provisioning Profiles | |
cert | |
sigh(force: true) | |
# 2. | |
#ensure_git_status_clean | |
# 3.Creating the IPA file |
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
tell application "Xcode" | |
activate | |
end tell | |
delay 1 | |
tell application "System Events" | |
tell process "Xcode" | |
tell menu bar 1 | |
tell menu bar item 10 | |
tell menu 1 | |
tell menu item 12 |
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
CGPoint center= sender.center; | |
CGPoint rootViewPoint = [sender.superview convertPoint:center toView:self.myTableView]; | |
NSIndexPath *indexPath = [self.myTableView indexPathForRowAtPoint:rootViewPoint]; |
NewerOlder