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 config | |
import ( | |
"log" | |
"os" | |
"github.com/spf13/viper" | |
) | |
type ( |
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 { eachYearOfInterval, getMonth } from 'date-fns' | |
import currentData from './current.json' | |
// array | |
// obj.bio.gender Filter on gender only F | |
// obj.terms (Array) Filter on type only rep | |
// get start/end | |
const app = () => { | |
const women = (currentData as Array<unknown>).filter( | |
// @ts-ignore | |
val => val.bio.gender === 'F' |
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 * as React from "react"; | |
interface Props { | |
fallback: React.ReactElement; | |
} | |
interface State { | |
error: null | string; | |
hasError: boolean; | |
} |
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 { createCipheriv, createDecipheriv, randomBytes } from 'crypto' | |
const iv = randomBytes(process.env.RANDOM_INTEGER) | |
const cipher = createCipheriv(process.env.ALGORITHM, process.env.SECRET_KEY, iv) | |
export const encrypt = (object) => { | |
const encrypted = Buffer.concat([cipher.update(JSON.stringify(object)), cipher.final()]); | |
return { | |
content: encrypted.toString('hex'), | |
iv: iv.toString('hex'), |
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 * as React from 'react' | |
type RenderProps = { | |
close: () => void | |
isOpen: boolean | |
open: () => void | |
toggle: () => void | |
} | |
type Props = { |
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 * as React from 'react' | |
import styled from 'styled-components' | |
import "./styles.css"; | |
/** | |
* *Step 1:* | |
* - Render a list of items (*ul*) from the given *API endpoint*. | |
* - Create **<List />** and **<ListItem />** components. *(List renders ListItems)*. | |
* - Each *ListItem* needs to render the **id**, **title** and an **image** with the **thumbnailUrl**. | |
*/ |
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
[ | |
"//": "DraftJS will return a single object with this signature.", | |
"//": "If it has not text that property will be empty and that is what 'hasText()' is checking.", | |
"//": "The immutable data struct still exists though, so we need to blow it away using 'Draft.EditorState.createEmpty()'." | |
{ | |
"blocks": [ | |
{ | |
"key": "djgpq", | |
"text": "", | |
"type": "unstyled", |
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
# Name of this workspace. | |
name: CI | |
# Listens for PR's being opened and updated. | |
on: pull_request | |
jobs: | |
# My job | |
review_code: | |
# Environment to execute in. |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
</head> | |
<body> | |
<h1>Poop</h1> | |
<div id="content"></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
import { ApolloError } from 'apollo-boost' | |
// We may not need to pass the 'endpoint' through I forget what the ApolloError exposes for information. | |
export const onError (error: ApolloError, enpoint: string): void => { | |
// Add error logging service. | |
console.error(`Endpoint: ${endpoint}`, error) | |
} |
NewerOlder