Skip to content

Instantly share code, notes, and snippets.

Jack Tomaszewski jtomaszewski

Block or report user

Report or block jtomaszewski

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
jtomaszewski / axe.js
Last active Mar 11, 2019 — forked from donaldpipowitch/axe.js
aXe based a11y checks in your CI for Storybook
View axe.js
/* eslint-disable no-await-in-loop */
/* eslint-disable no-restricted-syntax */
// eslint-disable-next-line import/no-extraneous-dependencies
const puppeteer = require('puppeteer');
const { green, red, cyan, grey, bold } = require('chalk');
const url = 'http://localhost:9001/iframe.html';
function runAxe() {
return new Promise((resolve, reject) =>

Code formatting & linting

In AppUnite, we enforce proper code style by:

  1. formatting of all our **/*.{js,jsx,ts,tsx,css,less,scss} files with prettier,

  2. linting all **/*.js files with ESLint,

  3. linting all **/*.ts files with TSLint.

jtomaszewski / rt-stateful-component.ts
Created Jan 11, 2019
Example implementation of StatefulComponent in Angular
View rt-stateful-component.ts
// Code authored by [Recruitee](
// License: MIT
import { Injectable, ChangeDetectorRef } from '@angular/core';
import { BehaviorSubject, Observable } from 'rxjs';
const immutableStateInvariantMiddleware = process.env.NODE_ENV !== 'production'
? require('redux-immutable-state-invariant').default
: null;
export interface RtStatefulComponent<State> {
View flatten.js
flatten = array => {
return array.reduce((sum, x) => {
if (Array.isArray(x)) {
return [...sum, ...flatten(x)];
} else {
return [...sum, x];
}, [])
View good-dumb-components-example.ts
// wrong (impure)
class DateTimePickerComponent {
timeZone: string = "Europe/Warsaw";
constructor(private account: AccountService) {
if (this.account.currentUser) {
this.timeZone = this.account.currentUser.timeZone;
View my-search-page.component.html
<div class="sidebar">
<div class="content">

Code formatting & linting

In Recruitee, enforce correct formatting of our files with js-beautify for all src/ng2/**/*.html files and prettier for all **/*.{ts,js,css,less} files.

We also lint all **/*.ts files (and components' .html templates) code style with TSLint, although during the automatic linting, we ignore legacy files listed in ./tslint.without-legacy.json.

During npm install, husky automatically sets up a pre-commit hook in this repository, that will check your code before each commit and fail if it's wrong. If you want to skip the pre-commit hook, you can run git commit --no-verify.

Additionally, our CI will also check your code with npm run format-test && npm run lint command and fail if it's badly formatted or its' non-legacy fi

jtomaszewski /
Last active Jan 5, 2016
# Exit, if there's no ios here.
[[ $CORDOVA_PLATFORMS == *"ios"* ]] || exit 0
# This is needed until gets fixed.
if ! cat $XCCONFIG_FILE | grep -q "ENABLE_BITCODE"; then
jtomaszewski / deploy.rb
Last active Oct 21, 2015
Eye configuration for unicorn && sidekiq
View deploy.rb
# ...
namespace :deploy do
desc 'Restart application'
task :restart => ["eye:reload", "eye:restart"]
after :published, :restart
jtomaszewski /
Created Jan 7, 2015
Ionic Framework: Turn off animations on Android and iOS 6 devices.
app.config ($injector) ->
model = ionic.Platform.device().model or ""
animateNavigation = ionic.Platform.grade == "a"
unless animateNavigation
defaults =
transition: 'no-animation'
transition: 'no-animation'
You can’t perform that action at this time.