Skip to content

Instantly share code, notes, and snippets.

@guvener
guvener / intercept-puppeteer-sharp.js
Created September 15, 2023 11:03
intercept/convert image loading chrome puppeteer
await page.setRequestInterception(true);
page.on('request', async (req) => {
if (req.resourceType() !== 'image') {
return req.continue();
}
try {
const res = await axios.get(req.url(), { responseType: 'arraybuffer' });
const jpeg = await sharp(res.data).webp().toBuffer();
req.respond({ body: jpeg });
} catch(e) {
@guvener
guvener / tw-background-hex.md
Created April 30, 2022 08:46
Tailwind background colors HEX codes
@guvener
guvener / UILabel+BoldTag.h
Last active December 20, 2015 13:09
Simply applying partial bold style between tags inside UILabel class category. Usage: #import "UILabel+BoldTag.h" // import the category [lbl_player setText:@"You [b]want to play[/b]"]; [lbl_player renderBoldTag]; // render bold tag
//
// UILabel+BoldTag.h
//
// Created by Guvener Gokce on 8/2/13.
// Copyright (c) 2013 Gladly Interactive All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UILabel (BoldTag)