active: true derived: false level: 1.5 links:
- REQ004: 94f4db8d1a50ab62ee0edec1e28c0afb normative: true ref: '' reviewed: 98ba42c551fec65d9796fee72d15f844 title: Tutorial Requirement 17
import React, { useState, useCallback } from "react"; | |
import { useBlurhash } from "./use-blurhash"; | |
import { useInView } from "react-intersection-observer"; | |
type Props = React.DetailedHTMLProps< | |
React.ImgHTMLAttributes<HTMLImageElement>, | |
HTMLImageElement | |
> & { blurhash?: string | null }; | |
// Uses browser-native `loading="lazy"` to lazy load images |
using System; | |
using System.Threading; | |
static class Program { | |
static void Main() { | |
Console.Write("Performing some task... "); | |
using (var progress = new ProgressBar()) { | |
for (int i = 0; i <= 100; i++) { | |
progress.Report((double) i / 100); |
import React, { | |
createContext, | |
useReducer, | |
useEffect, | |
useState, | |
useContext, | |
} from 'react'; | |
import * as Oidc from 'oidc-client'; | |
// Inspired by https://github.com/Swizec/useAuth |
Write-Host Clear security certificates. Removes SSLCertificateSHA1Hash from the registry. | |
$name = 'SSLCertificateSHA1Hash' | |
$path = 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' | |
Remove-ItemProperty -Path $path -Name $name -ErrorAction SilentlyContinue | |
Set-ItemProperty -Path $path -Name 'MinEncryptionLevel' -Value 1 | |
Set-ItemProperty -Path $path -Name 'SecurityLayer' -Value 0 | |
Remove-ItemProperty -Path 'HKLM:\SYSTEM\ControlSet001\Control\Terminal Server\WinStations\RDP-Tcp' -Name $name -ErrorAction SilentlyContinue | |
Remove-ItemProperty -Path 'HKLM:\SYSTEM\ControlSet002\Control\Terminal Server\WinStations\RDP-Tcp' -Name $name -ErrorAction SilentlyContinue | |
Write-Host Clear security certificates. Set SSLCertificateSHA1Hash to . |
-- Based on https://stackoverflow.com/a/2926213/25182 | |
WITH a AS (SELECT LTRIM(dut_eosonum) AS s, '' AS x, 0 AS n | |
FROM dbo.[dutmast] | |
WHERE LEN(dut_eosonum)>0 | |
UNION ALL | |
SELECT a.s, SUBSTRING(a.s, n+1, 1) AS x, n+1 AS n FROM a WHERE n<LEN(a.s)) | |
SELECT x, COUNT(*) AS c FROM a WHERE n>0 GROUP BY x ORDER BY x | |
OPTION(MAXRECURSION 0); |
import {GraphQLExtension, GraphQLResponse} from 'graphql-extensions'; | |
import {formatApolloErrors} from 'apollo-server-errors'; | |
import {GraphQLError, GraphQLFormattedError} from 'graphql'; | |
import Logger from 'bunyan'; | |
import icepick from 'icepick'; | |
const filterOutErrorPaths = [ | |
['extensions', 'exception', 'options', 'auth', 'bearer'], | |
[ | |
'extensions', |
'use strict'; | |
const util = require('util'); | |
const format = util.format; | |
const http = require('http'); | |
const chalk = require('chalk'); | |
const stream = require('stream'); | |
const _merge = require('lodash/merge'); | |
const _get = require('lodash/get'); |
using System; | |
using System.Security.Cryptography; | |
using System.Text; | |
namespace Utility | |
{ | |
/// <summary> | |
/// Helper methods for working with <see cref="Guid"/>. | |
/// </summary> |
active: true derived: false level: 1.5 links:
using System; | |
using System.Security.Principal; | |
internal static class IdentityExtensions | |
{ | |
internal static string GetNormalizedLogin(this IIdentity identity) | |
{ | |
if (identity == null) | |
{ | |
throw new ArgumentNullException(nameof(identity)); |