Skip to content

Instantly share code, notes, and snippets.

View Igloczek's full-sized avatar

Bartek Igielski Igloczek

  • Bielsko-Biała, Poland
  • 18:44 (UTC +02:00)
  • X @igloczek
View GitHub Profile
@Igloczek
Igloczek / readme.md
Created March 31, 2025 11:45
How to replace sound Cursor uses to play after finish the work
  1. Set Cursor to use early access release channel, update it and enable "Play sound on finish"
  2. Download sound - https://www.myinstants.com/media/sounds/warcraft-ii-sound-effects-orc-peon-grunt_-_work-complete.mp3
  3. Open Cursor app internals - open /Applications/Cursor.app/Contents/Resources/app/out/vs/platform/accessibilitySignal/browser/media
  4. Replace done1.mp3 with the downloaded file
  5. Enjoy Cursor saying "Work complete!" using the Warcraft 2 orc voice, every time it finishes working on something ❤️

This guide is for macOS only.

@Igloczek
Igloczek / README.md
Created February 23, 2025 13:09
Klipper macro for semi-automated `rotation_distance` calibration

Klipper Extruder Calibration Macros

Why?

Klipper and Mainsail lack built-in extruder calibration. These macros automate it.

How It Works

  1. Mark the filament at 120mm before running the macro.
  2. Run:

EXTRUDER_CALIBRATION

@Igloczek
Igloczek / script.js
Created January 29, 2025 19:21
Spotify playlist tracks to text converter
(async function collectSpotifyPlaylist() {
const TRACK_SELECTOR = '._iQpvk1c9OgRAc8KRTlH';
// Find the correct scroll container
let scrollContainers = document.querySelectorAll('[data-overlayscrollbars-viewport]');
let scrollContainer = scrollContainers.length > 1 ? scrollContainers[1] : scrollContainers[0];
if (!scrollContainer) {
console.error("Could not find the scrollable playlist container.");
return;
@Igloczek
Igloczek / unfucked-chrome-storage-api.js
Created August 30, 2024 19:48
A way to unfuck the Chrome Storage API
export const storage = {
async get(key) {
return new Promise((resolve, reject) => {
chrome.storage.local.get(key, (result) => {
if (chrome.runtime.lastError) {
return reject(chrome.runtime.lastError)
}
resolve(result[key])
})
})
@Igloczek
Igloczek / inline.ts
Last active June 17, 2024 17:45
Astro middleware for inlining critical JS to reduce requests chains
// Not sure whether it's genius or stupid, but it definitely works.
// The goal is to reduce chaining critical requests.
// By default in most cases Astro do this: html -> small chunk -> big chunk(s), which is kinda like Require.js, where you need to download file, to know what file you want to download.
// Code below takes this small chunk and inlines it into html, so we have at least one client-side request to make less: html -> big chunk(s).
// Additionally we can add "modulepreload" to start fetching those files faster (not sure where in this particular case it makes any sense, but was easy to add, so I did it).
// For sure this code isn't optimal, I just quickly hacked it just to have PoC, but I belive it won't hurt server-side performance that much.
// If you know some better way to do it, that doesn't require digging through HTML and replacing strings, please let me know.
import fs from "node:fs"
import path from "node:path"
@Igloczek
Igloczek / verify-email.ts
Last active February 25, 2025 23:44
Simple way to filter out most of the disposable / temporary emails
import axios from "axios"
import TTLCache from "@isaacs/ttlcache"
const domainsCache = new TTLCache({
ttl: 1000 * 60 * 60 * 24,
}) as TTLCache<string, Set<string>>
interface ListConfig {
url: string
type: "text" | "json"
@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'],