by Jacek Tomaszewski
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
/* 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) => |
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
flatten = array => { | |
return array.reduce((sum, x) => { | |
if (Array.isArray(x)) { | |
return [...sum, ...flatten(x)]; | |
} else { | |
return [...sum, x]; | |
} | |
}, []) | |
}; |
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
// wrong (impure) | |
class DateTimePickerComponent { | |
timeZone: string = "Europe/Warsaw"; | |
constructor(private account: AccountService) { | |
if (this.account.currentUser) { | |
this.timeZone = this.account.currentUser.timeZone; | |
} | |
} |
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
<div class="sidebar"> | |
<my-search-page-sidebar | |
[filters]="state.filters" | |
(filtersChange)="changeFilters($event)"> | |
</my-search-page-sidebar> | |
</div> | |
<div class="content"> | |
<h2>Search</h2> | |
<my-search-page-query-input | |
[value]="state.query" |
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
#!/bin/sh | |
iptables -F | |
iptables -X | |
iptables -P INPUT DROP | |
iptables -P FORWARD DROP | |
iptables -P OUTPUT ACCEPT | |
iptables -A INPUT -i lo -j ACCEPT | |
iptables -A FORWARD -o lo -j ACCEPT | |
iptables -A INPUT -j ACCEPT -m state --state ESTABLISHED,RELATED |
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
# Idea from http://krautcomputing.com/blog/2012/10/07/how-to-make-everything-background-processable-through-sidekiq/ | |
# | |
# Usage: | |
# | |
# class Synchronization | |
# include Asyncable | |
# end | |
# | |
# Then: | |
# Synchronization.find(12).perform_async(:synchronize, 3, 2) |
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
app.config ($injector) -> | |
model = ionic.Platform.device().model or "" | |
animateNavigation = ionic.Platform.grade == "a" | |
unless animateNavigation | |
defaults = | |
'$ionicNavBarConfig': | |
transition: 'no-animation' | |
'$ionicNavViewConfig': | |
transition: 'no-animation' |
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
// See issue https://github.com/twbs/bootstrap/issues/8810 for more information. | |
// | |
// Thanks for the idea of the fix to: | |
// https://github.com/sixfootsixdesigns/Bootstrap-3-Grid-Columns-Clearing | |
@import "bootstrap/variables" | |
// Useful @media mixins (based on dimensions taken from bootstrap-sass) | |
=media-width-below($max) |