This file contains 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 function buildSequenceItem({ activity, baseUrl, sequenceItem }: { | |
activity: Activity, | |
baseUrl: string, | |
sequenceItem: SequenceItem, | |
}): SequenceItemUI { | |
} | |
export function buildQuestionPool( |
This file contains 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 function Logo({ src }: { | |
src: string, | |
}) { | |
return ifPresent(src, ( | |
<div className='web-activity-header-logo'> | |
<img src={src} className='web-activity-header-img' /> | |
</div> | |
)); | |
} |
This file contains 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 | |
# | |
alias g='git' | |
alias gl="clear && git log" | |
alias gll="clear && git log --graph --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative" | |
alias glp="clear && git log -p" | |
alias gs="clear && git status -sb" |
This file contains 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 a helper component that allows for easy translations in views w/o | |
// needing to use the context directly. Only handles simple key lookup at the | |
// moment. | |
function Translate({ id }: { | |
id: keyof T | |
}) { | |
return ( | |
<i18nContext.Consumer> | |
{ | |
({ translate }) => translate(id) |
This file contains 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
{ | |
"React component": { | |
"prefix": "com", | |
"body": [ | |
"import React, { Component } from 'react';", | |
"", | |
"interface Props {", | |
" $3", | |
"}", | |
"", |
This file contains 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
// Current setup is a all styles go in a single file w/ a single flat `[element name]: { styles for that element }` block: | |
export const defaultStyles = { | |
quizHeader: { | |
display: 'flex', | |
}, | |
quizHeaderLogo: { | |
background: '', | |
}, |
This file contains 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 { tryJsonParse } from "./tryJsonParse"; | |
// Small wrapper around localStorage that converts to/from json. | |
// | |
// We also define all localStorage keys/values we store upfront here. | |
// This way all values are documented, and we get type saftey. | |
// | |
interface LocalStored { | |
device_info: string; | |
debugRedirects: boolean; |
This file contains 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
// Based on: https://github.com/JedWatson/classnames/blob/master/index.js | |
/*! | |
Copyright (c) 2018 Jed Watson. | |
Licensed under the MIT License (MIT), see | |
http://jedwatson.github.io/classnames | |
*/ | |
var hasOwn = {}.hasOwnProperty; | |
export function classNames(...args: any[]) { |
This file contains 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
class BaseballCards extends Component { | |
render() { | |
return <b onClick={this.onClick}> sup</b> | |
} | |
// class-level prop, gets .bind(this) when constructing the object so `this` is always the correct object instance. | |
onClick = (event) => { | |
console.log(this, 'rules!') | |
} | |
} |
This file contains 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
interface RequestOptions { | |
authToken?: string | |
} | |
interface Fun { | |
age: number; | |
} | |
const InitEndpoint = { | |
get({ id }: { id: string }, options?: RequestOptions): Promise<Fun> { | |
return Promise.resolve({ age: 1}) |