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
// In Android wdio config | |
config = { | |
before() { | |
global.$ = selector => { | |
const enhancedSelector = | |
typeof selector === 'string' && selector.startsWith('~') | |
? `//*[@resource-id="${selector.slice(1)}"]` | |
: selector | |
return driver.$(enhancedSelector) |
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') |
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' }, |
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)' }} |
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); | |
} |
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%; |
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 += '/'); |
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; |
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: |
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> |
NewerOlder