Skip to content

Instantly share code, notes, and snippets.

View Igloczek's full-sized avatar

Bartek Igielski Igloczek

  • Bielsko-Biała, Poland
  • 11:57 (UTC +02:00)
  • X @igloczek
View GitHub Profile
@Igloczek
Igloczek / verify-email.js
Last active April 30, 2024 11:08
Simple way to filter out most of the disposable / temporary emails
import TTLCache from "@isaacs/ttlcache"
import axios from "axios"
const domainsCache = new TTLCache({
ttl: 1000 * 60 * 60 * 24, // cache for 24h
})
const lists = [
"https://raw.githubusercontent.com/wesbos/burner-email-providers/master/emails.txt", // submiting my findings here
"https://raw.githubusercontent.com/Igloczek/burner-email-providers/master/emails.txt", // adding my fork, as sometime PRs are stuck unmerged
@Igloczek
Igloczek / derecrutify-your-linkedin.js
Last active July 5, 2022 18:18
Scripts that removes recruiters from your LinkedIn contacts
// How to use this script?
// 1. Set LinkedIn language to engligh (I just didn't test it on others)
// 2. Go to https://www.linkedin.com/mynetwork/invite-connect/connections/
// 3. Paste this script to the console and watch :)
[...document.querySelectorAll('.mn-connection-card')]
// Comment out line below, if you want to remove not only people joined your network in the last year
.filter(el => el.querySelector('.time-badge').innerText.search(/year/igm) === -1)
.filter(el => el.querySelector('.mn-connection-card__occupation').innerText.search(/recruit|rekru|hr|talent|headhunter|people|resource|hiring|build|job|researcher/gmi) !== -1)
.forEach((el, index) => {
@Igloczek
Igloczek / inline-styles.mjs
Created February 19, 2022 11:36
Astro JS - Inline CSS
import path from 'node:path'
import fs from 'node:fs/promises'
import { globby } from 'globby'
const files = await globby('./dist/**/index.html')
await Promise.all(
files.map(async htmlPath => {
const pageStyles = []
const stylesPaths = []
@Igloczek
Igloczek / imports.js
Last active June 4, 2019 13:14
Tool for moving components imports from JS to Vue SFC
const fs = require('fs-extra')
const path = require('path')
const glob = require('glob')
const prettier = require('prettier')
const components = glob
.sync('src/*/*/*.js', { ignore: '**/*.{stories,stories_,spec}.js' })
.map(file => ({
src: file,
name: path.basename(file)
@Igloczek
Igloczek / build.js
Created June 4, 2018 18:51
Magento 2 bundling setup
{
// Enable js minification with Uglify. Uncomment this out during development tomake builds faster
optimize: 'none',
inlineText: true,
baseUrl: '/Users/igloczek/Sites/magento2-bundling/pub/static/frontend/Magento/luma/source',
dir: '/Users/igloczek/Sites/magento2-bundling/pub/static/frontend/Magento/luma/en_US',
// Shim configuration for non-AMD modules. Copied from requirejs-config
shim: {
'jquery/jquery-migrate': ['jquery'],
'jquery/jquery.hashchange': ['jquery', 'jquery/jquery-migrate'],
@Igloczek
Igloczek / replace.js
Created May 21, 2018 14:25
Vue mixin object from component
const glob = require('glob')
const fs = require('fs')
glob('core/components/**/*.js', (temp, files) => {
files.forEach(path => {
// const file = require('./' + path)
console.log(path)
let file = fs.readFileSync('./' + path, 'utf8')
file = file.replace(/import Vue from 'vue'\n/gm, '')
@Igloczek
Igloczek / README.md
Created May 19, 2018 11:46
Quick way to capitalize bunch of file names

Remeber to use git config core.ignorecase false while you are on case insensitive partition

@Igloczek
Igloczek / domready.js
Created April 5, 2017 21:12
DOM Ready event
window.domReady = function(callback) {
var ready = false;
var detach = function() {
if(document.addEventListener) {
document.removeEventListener("DOMContentLoaded", completed);
window.removeEventListener("load", completed);
}
else {
document.detachEvent("onreadystatechange", completed);
@Igloczek
Igloczek / index.js
Created March 5, 2017 12:20
Extremely simple CSS specificity analyzer
const css = require('css'),
fs = require('fs'),
specificity = require('specificity');
function getSelectorsWithHighSpecificity(cssFilePath, maxSpecificity) {
const cssFile = fs.readFileSync(cssFilePath, 'utf8'),
output = [];
css.parse(cssFile).stylesheet.rules.forEach(rule => {
if (rule.type === 'rule') {
@Igloczek
Igloczek / bemed-clean.phtml
Last active January 5, 2021 10:57
Example of use BEM methodology in Magento 2
<form class="form">
<h2 class="form__header"></h2>
<p class="form__description"></p>
<div class="form__field field">
<label class="field__label"></label>
<input class="field__input">
</div>
<div class="form__field field">
<label class="field__label"></label>
<input class="field__input">