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
| public abstract class Option<TValue> where TValue : struct | |
| { | |
| protected TValue? value; | |
| } | |
| public class Some<TValue> : Option<TValue> where TValue : struct { | |
| public TValue Value => value.Value; | |
| public Some(TValue input) | |
| { |
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
| $ErrorActionPreference = "stop" | |
| $backslash = "\" | |
| $inputdir = Read-Host -Prompt "Enter an absolute path to input folder: " | |
| $outputdir = Read-Host -Prompt "Enter an absolute path to the output folder: " | |
| $inputdirname = Split-Path -Path $inputdir -Leaf | |
| $old_copy = $outputdir + $backslash + $inputdirname + $backslash | |
| Write-Host "deleting previous deployment at $old_copy" |
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 { MatSnackBar } from '@angular/material'; | |
| import { HttpErrorResponse } from '@angular/common/http'; | |
| import { Injectable } from '@angular/core'; | |
| import { isnullorundefined } from '../utility/utilities'; | |
| /** requires @angular/material, MatSnackBarModule, isnullorundefined */ | |
| @Injectable({ | |
| providedIn: 'root' | |
| }) | |
| export default class snackbarservice |
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
| const nooccurrence = -1 | |
| export function translateelement(element: HTMLElement | SVGElement, translationkey: string, translationvalue: string) { | |
| let newtransform = `${translationkey}(${translationvalue})` | |
| if(element.style.transform.indexOf(translationkey) !== nooccurrence) { | |
| let anyvalueregex = new RegExp(`${translationkey}\\(.+\\)`) //any translationvalue one or more times | |
| let replacement = element.style.transform.replace(anyvalueregex, newtransform) | |
| element.style.transform = replacement | |
| } |
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
| fn main() { | |
| let output = game(204); | |
| assert_eq!(output, vec![20808]); | |
| } | |
| pub fn game(n: u64) -> Vec<u64> { | |
| println!("input: {}", n); | |
| if n == 0 { | |
| return vec![n]; |
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
| function isIOS() { | |
| let tester = new RegExp("/iPad|iPhone|iPod/") | |
| let IOSdetected = tester.test(navigator.userAgent) | |
| let msStreamNotUsed = isNullOrUndefined(window.MSStream) //prevent fake user agent in internet explorer | |
| if (IOSdetected === true && msStreamNotUsed) { | |
| return true | |
| } | |
| return false | |
| } |
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
| actionmock = new HttpActionContext(); | |
| var headerValue = new AuthenticationHeaderValue("Basic", "bzUwkDal="); | |
| var request = new HttpRequestMessage(); | |
| request.Headers.Authorization = headerValue; | |
| var controllerContext = new HttpControllerContext(); | |
| controllerContext.Request = request; | |
| var context = new HttpActionContext(); | |
| context.ControllerContext = controllerContext; |
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 {exec, execFile, spawn, ChildProcess} from 'child_process' | |
| import { tick } from '@angular/core/testing'; | |
| export class ApiTestServer | |
| { | |
| private serverprocess : ChildProcess | |
| constructor() | |
| { | |
| this.serverprocess = execFile("C:\\Program Files\\IIS Express\\iisexpress.exe", [ |
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
| $ErrorActionPreference = 'stop' | |
| $previousdirectory = (Get-Item -Path './').FullName | |
| Write-Host "projects will pack to current directory $previousdirectory" | |
| $versionnum = Read-Host -Prompt 'enter version number' | |
| if($versionnum -eq '') | |
| { | |
| Write-Host 'using default version number.' | |
| $versionnum = '1.0.0' | |
| } |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Diagnostics; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| using Xunit; | |
| using System.Management.Automation; | |
| using System.Windows.Forms; |
NewerOlder