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
| git fetch -p && for branch in `git branch -vv --no-color | grep ': gone]' | awk '{print $1}'`; do git branch -D $branch; |
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.Linq; | |
| using Microsoft.Extensions.Configuration; | |
| using Microsoft.Extensions.DependencyInjection; | |
| using Microsoft.Extensions.Options; | |
| namespace Web.Extensions | |
| { | |
| public static class ServiceCollectionExtensions |
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 ReactDOM from "react-dom"; | |
| import "./styles.css"; | |
| const UserAvatar = ({ user, size }) => ( | |
| <img | |
| className={`user-avatar ${size || ""}`} | |
| alt="user avatar" | |
| src={user.avatar} | |
| /> |
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, { useState, useEffect } from 'react'; | |
| import './App.css'; | |
| import { Route, Switch } from 'react-router'; | |
| import { Container, Breadcrumb, BreadcrumbItem, Button } from 'reactstrap'; | |
| import useFetch from './util/useFetch'; | |
| import { Home } from './routes/Home'; | |
| import { Buyer } from './routes/Buyer'; | |
| import { Seller } from './routes/Seller'; | |
| import { Demo } from './routes/Demo'; | |
| import { Scoreboard } from './components/Scoreboard'; |
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
| /* Assessment: | |
| * Native date creation -> Non-ISO will create date in current timezone | |
| * Native date creation -> ISO will create date in GMT timezone | |
| - When parsing "literal" ISO, parseISO & parseJSON are same - identical to native | |
| * When parsing "short" ISO, parseISO converts ISO string yyyy/mm/dd to local timezone (adds time offset) unlike native | |
| * formatISO should be used for converstion to date string yyyy/mm/dd? What happens when it is converted back into a DateTime? Assume UTC? | |
| * DatePicker, push in a parseISO date or ISO string, outputs a date type with HST offset | |
| * | |
| */ | |
| describe('Date: Timezones', () => { |
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, { createContext, useContext, useState } from '~/session/react'; | |
| import Session from 'sessionModule'; | |
| import { resetSessionRequest } from 'session-client'; | |
| const SessionContext = createContext(Session.default()); | |
| SessionContext.displayName = 'Session'; | |
| function useSession(initialSession) { | |
| const [session, setSession] = useState(initialSession); |
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 axios from 'axios'; | |
| import { useEffect } from 'react'; | |
| function useEffectAsync(callbackAsync, useEffectDeps) { | |
| var source = axios.CancelToken.source(); | |
| useEffect(()=> { | |
| callbackAsync(source.token) | |
| .catch(error => { | |
| if(!axios.isCancel(error)) { | |
| throw error; |
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 { useState, useRef, useEffect, useCallback } from 'react'; | |
| /* | |
| * useSafeState prevents state from being updated if a component has been | |
| * unmounted during an async process, thus preventing React from throwing errors | |
| * around it. | |
| * | |
| * Usage is just like regular useState: | |
| * const [myState, setMyState] = useSafeState("Initial state"); | |
| */ |
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 getDomainWithoutSubdomain = hostname => { | |
| const parts = hostname.split('.') | |
| return parts | |
| .slice(0) | |
| .slice(-(parts.length === 4 ? 3 : 2)) | |
| .join('.') | |
| } |
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
| <% if (htmlWebpackPlugin.options.applicationInsightsInstrumentationKey) { %> | |
| <!-- AppInsights --> | |
| <!-- Intended to be blocking, don't defer or load async --> | |
| <script type="text/javascript"> | |
| <% | |
| // https://docs.microsoft.com/en-us/azure/azure-monitor/app/javascript | |
| const {applicationInsightsInstrumentationKey: instrumentationKey, appInsights: props = {}} = htmlWebpackPlugin.options; | |
| const { role, roleInstance, version, onInit, onAfterInit, cfg, ...rest} = props; |
OlderNewer