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 class AuthTokenDocumentFilter : IDocumentFilter | |
{ | |
public void Apply(SwaggerDocument swaggerDoc, SchemaRegistry schemaRegistry, IApiExplorer apiExplorer) | |
{ | |
swaggerDoc.paths.Add("/token", new PathItem | |
{ | |
post = new Operation | |
{ | |
tags = new List<string> { "Auth" }, | |
consumes = new List<string> |
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 UIKit | |
class ViewController: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view, typically from a nib. | |
// Create a DatePicker | |
let datePicker: UIDatePicker = UIDatePicker() |
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
/* | |
Xaml example. | |
*/ | |
<?xml version="1.0" encoding="utf-8"?> | |
<ContentPage | |
xmlns="http://xamarin.com/schemas/2014/forms" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
xmlns:local="clr-namespace:YourNameSpace" | |
x:Class="YourNameSpace.ContentPage"> |
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
git mv -f OldFileNameCase newFileNameCase |
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
using Xamarin.Forms; | |
namespace YourNamespace.Controls | |
{ | |
public class ExtendedEntry : Entry { } | |
} |
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
namespace SameNameSpaceAsAutoGeneratedDbContext | |
{ | |
public interface IEntity | |
{ | |
int Id { get; set; } | |
DateTime CreatedAt { get; set; } | |
DateTime? UpdatedAt { get; set; } | |
DateTime? DeletedAt { get; set; } | |
} | |
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
using System; | |
using System.Net; | |
using System.Net.Http; | |
using System.Web.Http.Controllers; | |
using System.Web.Http.Filters; | |
namespace MyAwesomeWebApi.ActionFilters | |
{ | |
/// <summary> | |
/// Returns 400 if the ModelState is invalid. |
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
# Recursively find and delete "bin", "obj" and "packages" dirs | |
# Backup your code before using this script, I am not responsible for any data loss. Please use it wisely. | |
find . -iname "bin" -o -iname "obj" -o -iname "packages" | xargs rm -rf |
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 class ClipboardService : IClipboardService | |
{ | |
public string GetTextFromClipboard() | |
{ | |
var clipboardmanager = (ClipboardManager)Forms.Context.GetSystemService(Context.ClipboardService); | |
var item = clipboardmanager.PrimaryClip.GetItemAt(0); | |
var text = item.Text; | |
return text; | |
} |
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
/* | |
* First commit any outstanding code changes before executing this command. | |
* Source: https://stackoverflow.com/a/38451183/1970317 | |
*/ | |
git rm -r --cached . | |
git add . | |
git commit -m "Fix .gitignore by {UPDATE}" |
OlderNewer