Skip to content

Instantly share code, notes, and snippets.

View przemyslawjanpietrzak's full-sized avatar

Przemyslaw Jan Beigert przemyslawjanpietrzak

View GitHub Profile
{
SMALL: string,
MEDIUM: string,
LARGE: string,
}
export const BUTTON_SIZES = {
SMALL: 'small',
MEDIUM: 'medium',
LARGE: 'large',
} as const;
for file in ./assets/**/*.svg
do
npx svgo $file "$file"
done
import Vuex, { Store } from 'vuex';
import { createLocalVue, shallowMount } from '@vue/test-utils';
import $NAME$ from './$NAME$.vue';
describe('$NAME$', () => {
const createComponent = ({} = {}) => {
const localVue = createLocalVue();
localVue.use(Vuex);
const store = new Store({
git config --global core.excludesfile ~/.gitignore
for f in src/**/*.js; do
git mv "$f" "${f%.js}.ts"
done
jq '.dependencies | keys | .[]' package.json | xargs yarn add
jq '.devDependencies | keys | .[]' package.json | xargs yarn add --dev
// @ts-check
module.exports = function (fileInfo, api, options) {
const j = api.jscodeshift
const ast = j(fileInfo.source);
const isContainsReducerInName = a => a.value.id.name === 'delayedEmailsReducer';
const hasTwoNodesInBody = a => a.value.body.length === 2;
const isSecondElementBreak = a => a.value.body[1].type === 'BreakStatement';
const isFirstElementExpression = a => a.value.body[0].type === 'ExpressionStatement';
const isFirstElementAssignment = ({operator, leftName}) => a => {
{
// Place your create-espeo-app workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
"Create type safe action": {
"scope": "typescript",
interface Data {
fn(arg: string): Array<string>
fn(arg: number): null
}
let data: Data;
const a = data.fn(42); // null
const b = data.fn("str"); // Array<string>
interface API {