Skip to content

Instantly share code, notes, and snippets.

View pkellner's full-sized avatar

Peter Kellner pkellner

View GitHub Profile
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using EFLibSvcc.Models;
using Microsoft.EntityFrameworkCore;
namespace CarvedRock.Api.Repositories
{
public class RoomRepository
{
using System;
using System.Collections.Concurrent;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Caching.Memory;
namespace ClassLib.CacheExtension
{
public class TCache<T>
{
const withCSS = require('@zeit/next-css');
require('dotenv').config();
const path = require('path');
const Dotenv = require('dotenv-webpack');
const withImages = require('next-images');
const withTypescript = require('@zeit/next-typescript');
const withOffline = require('next-offline');
//const isProd = process.env.NODE_ENV === 'production';
import { RunTypes } from '../components/codecamp/common/CodeCampInterfaces';
import getConfig from 'next/config';
const { publicRuntimeConfig } = getConfig();
/** A function that when called will return an environmental variable
* specified either in the .env file or the next.config.js defaults
* @param envKey value passed in which is environmental value without_DEV,_PROD or _STAGING
* @param devProdOrStaging
* @devProdOrStaging can only be "DEV","PROD", or "STAGING". If not included, then will default to process_env.NODE_ENV
* @returns returns the value after evaluating based on process.env.NODE_ENV
import axios from 'axios';
import { IUserInfo } from '../components/codecamp/common/CodeCampInterfaces';
//import getEnvParameters from './getEnvParameter';
//import getConfig from 'next/config';
//const { publicRuntimeConfig } = getConfig();
const fetchUserInfoPromise: Promise<{userInfo: IUserInfo} | {hasErrored: boolean,isServer: boolean,errorMessage: any}> = (cookieValue: string) => {
//$$$ TODO: check for cookieValue and if null, just return empty speaker so don't need to do check on every request
import React, { FunctionComponent } from 'react';
import axios, { AxiosResponse } from 'axios';
import useAxiosFetch from '../src/components/codecamp/common/hooks/useAxiosFetch';
import getConfig from 'next/config';
import App from '../src/App';
import { IUserInfo, Session } from '../src/components/codecamp/common/CodeCampInterfaces';
import fetchUserInfoPromise from '../src/utils/fetchUserInfoPromise';
...
render() {
return (
<div
className={`${this.props.className
? this.props.className
: ''} session-status-dropdown`}
ref={dropdownContainer => {
this.dropdownContainer = dropdownContainer;
import React, {FunctionComponent} from 'react';
import axios, {AxiosResponse} from 'axios';
import useAxiosFetch
from '../src/components/codecamp/common/hooks/useAxiosFetch';
import getConfig from 'next/config';
import App from "../src/App";
import {Speaker} from "../src/components/codecamp/common/CodeCampInterfaces";
import React, {FunctionComponent} from 'react';
import axios, {AxiosResponse} from 'axios';
import useAxiosFetch
from '../src/components/codecamp/common/hooks/useAxiosFetch';
import getConfig from 'next/config';
import App from "../src/App";
import {Speaker} from "../src/components/codecamp/common/CodeCampInterfaces";
@pkellner
pkellner / speakers.tsx
Created December 21, 2018 21:30
Need typescript Props interface for getInitialProps
import React, {FunctionComponent} from 'react';
import axios, {AxiosResponse} from 'axios';
import useAxiosFetch
from '../src/components/codecamp/common/hooks/useAxiosFetch';
import getConfig from 'next/config';
import App from "../src/App";
import {Speaker} from "../src/components/codecamp/common/CodeCampInterfaces";