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
<#@ template debug="false" hostspecific="true" language="C#" #> | |
<#@ assembly name="System.Core" #> | |
<#@ assembly name="System.Linq" #> | |
<#@ assembly name="System.Xml" #> | |
<#@ assembly name="System.Xml.Linq" #> | |
<#@ import namespace="System.Linq" #> | |
<#@ import namespace="System.Text" #> | |
<#@ import namespace="System.Collections.Generic" #> | |
<#@ import namespace="System.Linq" #> | |
<#@ import namespace="System.Xml.Linq" #> |
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
#!/usr/bin/python | |
# usage: | |
# ensure wallet config has these items without the # prefix, restart the wallet | |
# if they need to be added to the config: | |
# | |
# server=1 | |
# rpcuser=anrpcusername | |
# rpcpassword=apassword | |
# |
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 React, { Component } from 'react'; | |
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'; | |
import Login from 'components/Login' | |
import DefaultComponent from 'components/DefaultComponent' | |
class DebugRouter extends Router { | |
constructor(props){ | |
super(props); | |
console.log('initial history is: ', JSON.stringify(this.history, null,2)) | |
this.history.listen((location, action)=>{ |
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 {useLayoutEffect, useRef} from "react"; | |
export default function useFadeOut(ref, fadeTime, visible) | |
{ | |
const timerId = useRef(); | |
useLayoutEffect(() => | |
{ | |
clearTimeout(timerId.current); |
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 { AzureCustomizationsLight, AzureCustomizationsDark } from "@uifabric/azure-themes"; | |
import { ThemeProvider as FluentThemeProvider } from "@fluentui/react-theme-provider"; | |
import React, { createContext, PropsWithChildren, useContext, useState } from "react"; | |
import { useLocalStorage } from "../hooks/useLocalStorage"; | |
interface IThemeContext | |
{ | |
themeName: string; |
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 React from "react"; | |
import { Avatar } from "./Avatar"; | |
export default function App() | |
{ | |
return ( | |
<div className="App"> | |
<Avatar name="display middle name" background="#1FDA8A" size={32} highContrast={false} rounded={false} bold={true} /> | |
</div> |
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 ts-nameof | |
useLogStateChanges(nameof(SomeComponent), | |
[ | |
[nameof(value), value], | |
[nameof(startDate), startDate, val => (val as Date).valueOf().toString()], | |
[nameof(endDate), endDate] | |
]); | |
// using strings :( | |
useLogStateChanges("SomeComponent", |
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
export enum HttpStatus | |
{ | |
Continue = 100, | |
SwitchingProtocols = 101, | |
Processing = 102, | |
EarlyHints = 103, | |
OK = 200, | |
Created = 201, | |
Accepted = 202, |
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 { expect } from "chai"; | |
import { describe, it } from "mocha"; | |
import * as faker from "faker"; | |
import { Guid, GuidFormat } from "../Guid"; | |
describe(nameof(Guid), () => | |
{ | |
const empty = "00000000-0000-0000-0000-000000000000"; |
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
// util to code generate an object from another object where all the resulting object | |
// keys equal their respective paths within the object. | |
// | |
// useful for removing magic i18n strings from code. | |
/* eslint-disable @typescript-eslint/no-var-requires */ | |
const dot = require("dot-object"); | |
const fs = require("fs"); | |
const path = require("path"); |
OlderNewer