View require.js
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 { createRequire } from 'module' | |
const require = createRequire(import.meta.url) | |
export const expoConfig = require('/package.json') |
View helpers.ts
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
// W3C Actions | |
await driver.performActions([ | |
{ | |
type: 'pointer', | |
id: 'finger1', | |
parameters: { pointerType: 'touch' }, | |
actions: [ | |
{ type: 'pointerMove', x: 100, y: 300 }, | |
{ type: 'pointerDown', duration: 1000 }, | |
{ type: 'pointerUp' }, |
View workflow.yml
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
env: | |
# Add an optional dynamic string based on a PR number | |
SOME_ENV_VAR: static-string/${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || '' }} | |
jobs: | |
some-job: | |
steps: | |
# Conditionally name a step | |
- name: Step for ${{ github.event_name == 'pull_request' && '(PR)' || '(main)' }} |
View useMountedEffect.tsx
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 { useRef, useEffect } from 'preact/hooks'; | |
export function useMountedEffect(cb: () => void, deps?: ReadonlyArray<unknown>): void { | |
const didMount = useRef(false); | |
useEffect(() => { | |
if (didMount.current) cb(); | |
else didMount.current = true; | |
}, deps); | |
} |
View divider.css
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
.divider { | |
margin: 1.5rem 0; | |
position: relative; | |
overflow: hidden; | |
&::before, | |
&::after { | |
content: ''; | |
position: absolute; | |
top: 50%; |
View redirect-to-trailing-slash.js
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
window.location.href.match(/[^/]$/) && (window.location.href += '/'); |
View global.js
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
const requireComponent = require.context( | |
'~/components', // components dir | |
true, // recursive | |
/^(\.\/.*)*V[A-Z].+\.vue$/, // name regex | |
); | |
requireComponent.keys().forEach(fileName => { | |
let baseComponentConfig = requireComponent(fileName); | |
baseComponentConfig = baseComponentConfig.default || baseComponentConfig; |
View config.yaml
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
version: 2 | |
references: | |
container_config: &container_config | |
docker: | |
- image: circleci/node:10.8 | |
restore_deps_cache: &restore_deps_cache | |
restore_cache: | |
keys: |
View js-enabled
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
<script>(function(d){d.className=d.className.replace(/\bno-js\b/,'js-enabled')})(document.documentElement)</script> |
View .eslintrc
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
{ | |
"extends": "eslint:recommended", | |
"root": true, | |
"env": { | |
"es6": true, | |
"browser": true, | |
"node": true | |
}, | |
"parserOptions": { | |
"sourceType": "module" |
NewerOlder