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 { render, screen } from '@testing-library/react'; | |
import React, { createContext } from 'react'; | |
import { ComposeProviders } from './ComposeProviders'; | |
const DummyContextA = createContext<string>(''); | |
const DummyContextB = createContext<string>(''); | |
const DummyContextC = createContext<string>(''); | |
const DummyApp: React.FC = () => ( |
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
{ | |
"breadcrumbs.enabled": true, | |
"editor.accessibilitySupport": "off", | |
"editor.autoClosingBrackets": "never", | |
"editor.autoClosingQuotes": "never", | |
"editor.autoSurround": "never", | |
"editor.cursorBlinking": "phase", | |
"editor.defaultFormatter": "esbenp.prettier-vscode", | |
"editor.detectIndentation": true, | |
"editor.emptySelectionClipboard": false, |
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 iframe = document.createElement('iframe'); | |
iframe.src = 'data:text/html,'; | |
document.body.appendChild(iframe); | |
const guestWin = iframe.contentWindow; | |
const guestWinKeys = Object.keys(guestWin); | |
const hostWinKeys = Object.keys(window); | |
const diff = hostWinKeys.filter((key) => { | |
return !guestWinKeys.includes(key); | |
}).sort(); |
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 ( | |
typeof window.safeview !== 'undefined' && | |
typeof window.safeview.feedback_bar !== 'undefined' && | |
typeof window.safeview.feedback_bar.onBypassClick === 'function' && | |
confirm('Safeview detected. Bypassing.') | |
) window.safeview.feedback_bar.onBypassClick(); |
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
#!/bin/bash | |
REMOTE='origin' | |
SINCE='1 week ago' | |
DRY_RUN='' | |
todelete=() | |
for arg in "$@" | |
do | |
case $arg 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
import { create } from './pubsub'; | |
it('`create()` returns object with `publish` and `subscribe` fns', () => { | |
const result = create(); | |
expect(result).toBeInstanceOf(Object); | |
expect(result).toHaveProperty('publish'); | |
expect(result.publish).toBeInstanceOf(Function); | |
expect(result).toHaveProperty('subscribe'); | |
expect(result.subscribe).toBeInstanceOf(Function); | |
}); |
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"; | |
// Feature flag storage | |
const features = new Map(); | |
features.set('editor', true); | |
features.set('sandbox', true); | |
features.set('env', 'sit1'); | |
// Some dummy feature |
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
interface Permutation extends Array<number> {} | |
interface PermutationList extends Array<Permutation> {} | |
/** | |
* Gets all permutations of a given list of digits. Results are not guaranteed | |
* to be uniqe. | |
*/ | |
export const getPermutations = (input: Permutation): PermutationList => ( | |
input.length <= 1 ? [input] : input.reduce((result, n, i, arr) => ([ | |
...result, |
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> | |
<meta charset="utf-8"> | |
<title>Fauxcus</title> | |
<nav> | |
<li><a href="#">Home</a></li> | |
<li><a href="#">About</a></li> | |
<li><a href="#">Contact</a></li> | |
</nav> |
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'; | |
export interface Props { | |
children: number; | |
} | |
const Dollars: React.StatelessComponent<Props> = ({ children }) => ( | |
<> | |
{children.toLocaleString('en-AU', { | |
style: 'currency', |
NewerOlder