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
| #!/bin/sh | |
| # gclient can be found here: | |
| # git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git | |
| # don't forget modify .bashrc: | |
| # export PATH="$PATH":`pwd`/depot_tools | |
| function fetch() { | |
| echo "-- fetching webrtc" |
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
| #!/bin/sh | |
| for i in $(find . -name "*.p12"); do | |
| IN=$i | |
| OUT=$(echo $i | sed 's/\.p12/.pem/g') | |
| openssl pkcs12 -in $IN -out $OUT -nodes -clcerts | |
| done |
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
| #!/bin/sh | |
| rm -rf ~/Library/Developer/CoreSimulator/Devices | |
| killall -9 com.apple.CoreSimulator.CoreSimulatorService |
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
| extension UIViewController { | |
| func adjustTableViewInsects(tableView: UITableView?) { | |
| guard let tableView = tableView, let navigationController = navigationController else { | |
| return | |
| } | |
| automaticallyAdjustsScrollViewInsets = false | |
| let statusBarHeight = UIApplication.sharedApplication().statusBarFrame.size.height | |
| let navigationBarHeight = navigationController.navigationBar.bounds.size.height |
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
| #!/bin/sh | |
| if [[ -d $1 ]]; then | |
| for fileName in $1/* | |
| do | |
| if [ -d "$fileName" ]; then | |
| pushd "$fileName" | |
| mp3splt -c *.cue -o "@N @p - @t" -a *.mp3 || exit 1 | |
| popd | |
| fi |
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
| #!/bin/sh | |
| sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/11* \ | |
| /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/ # link image from beta to release |
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 Foundation | |
| enum OpParseError: Error { | |
| case Empty | |
| case Short | |
| } | |
| class Easysync2Support: NSObject { | |
| let opAssembler = OpAssembler() |
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
| extension UIFont { | |
| func smallCapsFont() -> UIFont { | |
| let attributes: [UIFontDescriptor.FeatureKey: Any] = [ | |
| .featureIdentifier: kLowerCaseType, | |
| .typeIdentifier: kLowerCaseSmallCapsSelector | |
| ] | |
| let descriptor = fontDescriptor.addingAttributes([ | |
| .featureSettings: [attributes], | |
| .name: fontName | |
| ]) |
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
| // | |
| // SplitViewController.swift | |
| // Gist | |
| // | |
| // Created by Maxim Potapov on 17/12/2017. | |
| // Copyright © 2017 Maxim Potapov. All rights reserved. | |
| // | |
| import UIKit |
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
| extension String { | |
| func capturedGroups(withRegex pattern: String) -> [String]? { | |
| guard let regex = try? NSRegularExpression(pattern: pattern, options: []) else { return nil } | |
| let matches = regex.matches(in: self, options: [], range: NSRange(location: 0, length: count)) | |
| guard let match = matches.first else { return nil } | |
| let lastRangeIndex = match.numberOfRanges - 1 | |
| guard lastRangeIndex >= 1 else { return nil } | |
| var results = [String]() | |
| for i in 1...lastRangeIndex { |
OlderNewer