const onlyLetters = str => str.replace(/[^a-zA-Z]/g, '');
const alphabetize = str => str.split('').sort().join('');
const toLowerCase = str => str.toLowerCase();
const fromCharCode = code => String.fromCharCode(code);
const charCode = char => char.charCodeAt(0);
const excludes = (str, char) => !str.includes(char);
const first = str => str[0];
const last = str => str[str.length - 1];
const defined = f => f || undefined;
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
say "Oh k, let's work" using "Oliver" | |
-- go to space 3 | |
tell application "System Events" | |
key code 20 using {control down} | |
end tell | |
-- start iTunes downtempo radio | |
tell application "Safari" | |
activate |
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 axios from 'axios'; | |
import {createAction} from 'redux-actions'; | |
export default store => next => action => { | |
const {dispatch} = store; | |
if (action.payload && action.payload.axios) { | |
return new Promise((res, rej) => { | |
const apiToken = store.getState().apiToken; | |
const payload = { | |
...action.payload.axios, |
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 axios, {getError} from 'services/axios'; | |
import {Component} from 'react'; | |
import {connect} from 'react-redux'; | |
import {delay} from 'lodash'; | |
import {getAuth} from 'rdx/selectors'; | |
import PropTypes from 'prop-types'; | |
/* eslint-disable no-console */ | |
class Axios extends Component { | |
static propTypes = { |
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, {Component} from 'react'; | |
import {delay} from 'lodash'; | |
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'; | |
import {getDisabled} from '../../utils/component'; | |
import PropTypes from 'prop-types'; | |
import './index.css'; | |
export default class Dialog extends Component { | |
static propTypes = { | |
cancel: PropTypes.string, |
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 {addDays, format, isAfter, isBefore, startOfDay} from 'date-fns'; | |
import React, {Component, Fragment} from 'react'; | |
import classes from 'classnames'; | |
import DatePickerDialog from './DatePickerDialog'; | |
import Dialog from 'components/Dialog'; | |
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'; | |
import {getDisabled} from '../../../utils/component'; | |
import PropTypes from 'prop-types'; | |
import './index.css'; |
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
// "word" array generator | |
const letter = () => String.fromCharCode(~~(Math.random() * 26) + 97); | |
const pair = () => `${letter()}${letter()}`; | |
const gen = length => | |
Array(length) | |
.fill() | |
.map(pair); |
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
<TaskOptions> | |
<TaskOptions> | |
<option name="arguments" value="$FileName$ --fix" /> | |
<option name="checkSyntaxErrors" value="true" /> | |
<option name="description" /> | |
<option name="exitCodeBehavior" value="ERROR" /> | |
<option name="fileExtension" value="css" /> | |
<option name="immediateSync" value="false" /> | |
<option name="name" value="Stylelint" /> | |
<option name="output" value="$FileDir$" /> |
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 { describe, expect, test } from 'vitest'; | |
import { tryCatch } from '../functions'; | |
describe('functions', () => { | |
test('tryCatch success', async () => { | |
expect(await tryCatch((value: number) => 10 / value, 5)).toEqual({ | |
result: 2, | |
}); | |
}); |