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 { Route, Switch } from 'react-router-dom'; | |
... | |
import { useRoutes } from 'hookrouter'; | |
export const routes = { | |
'/login': () => <Login /> | |
}; | |
const RenderRoutes = () => { |
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
# stdout a github secret (environment variable) to stdin with docker login command | |
- run: echo ${{ secrets.GHCP_ACCESS_TOKEN }} | docker login ghcr.io -u USERNAME --password-stdin |
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
//source: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/17355 | |
import { RouteComponentProps } from 'react-router-dom'; | |
type MyProps = RouteComponentProps<{ id?: string }> | |
const CoolThing: React.FC<MyProps> = ({ match }) => { | |
const id = match.params.id; | |
return ( |
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
it('only sends one welcome message', async () => { | |
mockPost('/chat.postMessage', { called: true }); | |
const channel = ''; | |
const user: SlackUser = { | |
token: '', | |
trigger_id: '', | |
view: undefined, | |
id: '', | |
team_id: '' | |
}; |
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
#define _CRT_SECURE_NO_WARNINGS | |
#include <stdio.h> | |
#define NUMBER_OF_DAYS 3 | |
// Put your code below: | |
int main(void) | |
{ | |
int k, highEntry, lowEntry; | |
printf("-- -= == IPC Temperature Analyzer == = --\n"); | |
for (int i = 1; i < NUMBER_OF_DAYS; i++) |
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
/* | |
Dave Schinkel's Notes after he wrote this test: | |
This is a test I wrote headlessly with Roboelectric around an existing Legacy codebase that's a mess. | |
We want to get some sort of confidence with an integration test which is what this test gave us for a | |
certain part of this codebase. | |
This test indirectly tests behavior further down by | |
checking what I ultimately expected to be rendered | |
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 gulp = require('gulp'), | |
less = require('gulp-less'), | |
babel = require("gulp-babel"), | |
shell = require('gulp-shell'), | |
mocha = require('gulp-mocha'), | |
rename = require('gulp-rename'), | |
bro = require('gulp-bro'), | |
del = require('del'), | |
{ series, dest, src } = require('gulp'); |
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
package roman.numeral.calculator.kotlin | |
class Calculator { | |
private val toRoman = mapOf( | |
"IIIII" to "V", | |
"VV" to "X", | |
"XXXXX" to "L", | |
"LL" to "C", | |
"CCCCC" to "D", |
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
package roman.numeral.calculator.kotlin | |
class Calculator { | |
private val toRoman = mapOf( | |
"IIIII" to "V", | |
"VV" to "X", | |
"XXXXX" to "L", | |
"LL" to "C", | |
"CCCCC" to "D", | |
"DD" to "M" |
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
/* | |
Note: | |
Uses superagent and mocha assertions. | |
This is how I do these tests nowdays, without supertest, just plain superagent. | |
*/ | |
import request from 'superagent' | |
it('returns a list of participants', async () => { | |
const url = 'https://someurl'; |