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 | |
if [ -n "$XcodeProjectPath" ]; then | |
open -a Terminal "$XcodeProjectPath"/.. | |
else | |
open -a Terminal "$XcodeWorkspacePath"/.. | |
fi |
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
extension Encodable { | |
func encode(with encoder: JSONEncoder = JSONEncoder()) throws -> Data { | |
return try encoder.encode(self) | |
} | |
} | |
extension Decodable { | |
static func decode(with decoder: JSONDecoder = JSONDecoder(), from data: Data) throws -> Self { | |
return try decoder.decode(Self.self, from: data) | |
} |
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 | |
# based on guide from Microsoft https://docs.microsoft.com/en-us/visualstudio/mac/uninstall | |
# Uninstall Visual Studio for Mac | |
echo "Uninstalling Visual Studio for Mac ..." | |
sudo rm -rf "/Applications/Visual Studio.app" | |
rm -rf ~/Library/Caches/VisualStudio | |
rm -rf ~/Library/Preferences/VisualStudio |
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 | |
import UIKit | |
// Usage Examples | |
let shadowColor = Color.shadow.value | |
let shadowColorWithAlpha = Color.shadow.withAlpha(0.5) | |
let customColorWithAlpha = Color.custom(hexString: "#123edd", alpha: 0.25).value | |
enum Color { | |
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
// NoEmptyRowsTableViewRenderer.cs | |
// | |
// No Rights Reserved | |
// http://creativecommons.org/publicdomain/zero/1.0/ | |
// | |
// Assume you have `MyProject.MyTableView` sublass of | |
// `Xamarin.Forms.TableView` and want to hide extra | |
// empty rows at the bottom. All you need on iOS is to set | |
// `TableFooterView` to empty `UIView` in custom renderer. | |
// |
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
extension UIViewController { | |
func topMostViewController() -> UIViewController { | |
if self.presentedViewController == nil { | |
return self | |
} | |
if let navigation = self.presentedViewController as? UINavigationController { | |
return navigation.visibleViewController.topMostViewController() | |
} | |
if let tab = self.presentedViewController as? UITabBarController { | |
if let selectedTab = tab.selectedViewController { |
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
If you are running a large website where you will need to test new features on a seperate url before pushing them live then the following instructions are for you ;) | |
For this example imagine your url is apple.com and you want a development/staging site on a subdomain which is dev.apple.com | |
#Setup# | |
1. First thing you'll want to do is go ahead and create your website in plesk and add the subdomain dev.apple.com at the same time. | |
2. ssh into the server e.g. $ ssh username@ipaddress | |
3. Once logged in cd into the private directory (this will be where all git repos are stored) e.g. $ cd ~/private | |
4. Create the main repo e.g. $ git init --bare apple.git | |
5. Now to clone this new repo on your local machine. $ git clone ssh://username@ipaddres/~/private/apple.com |
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
- (UIViewController *)topViewController{ | |
return [self topViewController:[UIApplication sharedApplication].keyWindow.rootViewController]; | |
} | |
- (UIViewController *)topViewController:(UIViewController *)rootViewController | |
{ | |
if (rootViewController.presentedViewController == nil) { | |
return rootViewController; | |
} | |
NewerOlder