Skip to content

Instantly share code, notes, and snippets.

View mateutek's full-sized avatar
💭
I may be slow to respond.

Mateusz Woźniak mateutek

💭
I may be slow to respond.
View GitHub Profile
const puppeteer = require('puppeteer');
function timeout(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
(async () => {
try {
const browser = await puppeteer.launch({ headless: false });
const page = await browser.newPage();
@mateutek
mateutek / jest.config.js
Created June 18, 2019 19:40
React + TS + Jest + Enzyme
module.exports = {
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
roots: [
'<rootDir>/src/',
'<rootDir>/tests/',
],
testRegex: '(<rootDir>/tests/.*|(\\.|/)(test|spec))\\.(ts|tsx)$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
@mateutek
mateutek / sassWars.sh
Created January 4, 2018 14:06
SassWars
#!/usr/bin/env bash
#
# Approach:
# 1. Find variable declaration in the form of "$my-var: anyvalue"
# 2. Loop through found variables and find occurrences of each variable in all scss files
if [ -z "$1" ]; then
echo "Please specify a directory as the first argument."
exit 1
fi
@mateutek
mateutek / index.html
Created August 16, 2012 09:04
Traversing
<div class="documents">
<div class="dates">
<p class="selldate">Sold: 16-07-2012</p>
</div>
........
</div>
<div class="documents">
<div class="dates">
<p class="selldate">Sold: 15-07-2012</p>