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 { createContext } from "react"; | |
const ThemeContext = createContext({}); | |
export default ThemeContext; |
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 React from "react"; | |
import styled, { ThemeProvider } from "styled-components"; | |
import theme from "styled-theming"; | |
export const backgroundColor = theme("theme", { | |
light: "#fff", | |
dark: "#2d2d2d", | |
}); | |
export const textColor = theme("theme", { |
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 React from "react"; | |
import styled, { ThemeProvider } from "styled-components"; | |
const Container = styled.div` | |
display: flex; | |
flex-direction: column; | |
width: 100vw; | |
height: 100vh; | |
align-items: center; | |
justify-content: center; |
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 React from "react"; | |
import styled from "styled-components"; | |
const Container = styled.div` | |
display: flex; | |
flex-direction: column; | |
width: 100vw; | |
height: 100vh; | |
align-items: center; | |
justify-content: center; |
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
param ( | |
[Parameter(Mandatory = $True)] | |
[string]$Description, | |
[Parameter(Mandatory = $True)] | |
[string]$Subject, | |
[Parameter(Mandatory = $True)] | |
[string]$JiraAuthKey | |
) | |
$DueDate = (Get-Date).ToString("yyyy-MM-dd'T'HH:mm:ss'.000+0100'") |
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
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. | |
public void Configure(IApplicationBuilder app, IHostingEnvironment env) | |
{ | |
app.UseExceptionHandler(errorApp => | |
{ | |
errorApp.Run(async context => | |
{ | |
var exceptionHandlingFeature = context.Features.Get<IExceptionHandlerPathFeature>(); | |
if (exceptionHandlingFeature?.Error is GuardException ex) |
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 static class Guard | |
{ | |
public static void GuidNotEmpty(Guid argument, string argumentName) | |
{ | |
if (argument == Guid.Empty) | |
throw new GuardException(argumentName, "Guid should not be empty."); | |
} | |
public static void StringNotNullOrEmpty(string argument, string argumentName) | |
{ |
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 sealed class GuardException : Exception | |
{ | |
public string ArgumentName { get; } | |
public GuardException(string argumentName, string message) | |
: base(message) | |
{ | |
ArgumentName = argumentName; | |
} | |
} |
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 static class Guard | |
{ | |
public static void GuidNotEmpty(Guid argument, string argumentName) | |
{ | |
if (argument == Guid.Empty) | |
throw new ArgumentException("Guid should not be empty.", argumentName); | |
} | |
public static void StringNotNullOrEmpty(string argument, string argumentName) | |
{ |
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
[HttpPost] | |
public async Task<IActionResult> Post(Guid id, string name) | |
{ | |
Guard.GuidNotEmpty(id, nameof(id)); | |
Guard.StringNotNullOrEmpty(name, nameof(name)); | |
// handle the request | |
} |