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
// | |
// GuardURLProtocol.swift | |
// URLProtocol | |
// | |
// Created by Bruno Philipe on 16/2/17. | |
// Copyright © 2017 Bruno Philipe. All rights reserved. | |
// | |
// 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 |
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
############################### | |
# get latest release git branch | |
############################### | |
desc "get latest release git branch" | |
private_lane :git_latest_release_branch do | |
pattern = "release\/(.+)" | |
branches = git_find_branches(pattern: pattern) | |
reg = Regexp.new(pattern) | |
branches = branches.sort { |a, b| |
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 | |
# ファイルの1年間のコミット数 | |
git ls-files | | |
while read file ; do | |
commits=`git log --since=1.year --no-merges --oneline -- $file | wc -l`; | |
echo "$commits - $file"; | |
done | sort -n |
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
import CommonCrypto | |
// MARK: AES128 暗号、復号化 | |
public extension String { | |
func aesEncrypt(key: String, iv: String) -> String? { | |
guard | |
let data = self.data(using: .utf8), | |
let key = key.data(using: .utf8), | |
let iv = iv.data(using: .utf8), |
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
import Foundation | |
extension String { | |
//Know if self is only composed by numbers | |
var isNumber: Bool { | |
return !self.isEmpty && CharacterSet.decimalDigits.isSuperset(of: CharacterSet(charactersIn: self)) | |
} | |
} | |
//Struct to check Regular Expresions |