Skip to content

Instantly share code, notes, and snippets.

View cilice's full-sized avatar

Alexander Plavinski cilice

  • 18:14 (UTC +01:00)
View GitHub Profile
@kettanaito
kettanaito / README.md
Last active December 16, 2025 01:25
Chromium on Vercel (serveless)

Chromium on Vercel (serverless)

This is an up-to-date guide on running Chromium in Vercel serverless functions in 2022. What you will read below is the result of two days of research, debugging, 100+ failed deployments, and a little bit of stress.

Getting started

Step 1: Install dependencies

Use chrome-aws-lambda that comes with Chromium pre-configured to run in serverless, and puppeteer-core due to the smaller size of Chromium distributive.

@antfu
antfu / doc-table.md
Last active October 14, 2023 20:09
Doc Table in Markdown

Example

Name

Description


@romkatv
romkatv / Pure style for Powerlevel10k.md
Last active October 15, 2025 04:09
Pure style for Powerlevel10k

Powerlevel10k can generate the same prompt as Pure.

pure

Installation

git clone https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k
echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc
const {useCallback, useEffect, useReducer, useRef} = require('react');
let effectCapture = null;
exports.useReducerWithEmitEffect = function(reducer, initialArg, init) {
let updateCounter = useRef(0);
let wrappedReducer = useCallback(function(oldWrappedState, action) {
effectCapture = [];
try {
let newState = reducer(oldWrappedState.state, action.action);

Fix absolutely positioned divs when people turn their phones sideways

The problem

In Safari, if you have a layout container that's absolutely positioned to take up, at a minimum, its whole container (which isn't unheard of in "appey" internet home page thingies) using CSS like this:

.absolutely
@sindresorhus
sindresorhus / post-merge
Last active January 17, 2026 16:21
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@badsyntax
badsyntax / find-unused-sass-variables.sh
Last active July 17, 2024 03:36 — forked from axelerator/Find unused variables in sass files
Find unused SCSS variables. Usage: `./find-unused-sass-variables.sh sassDir/`
#!/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 sass files
# 3. Filter out vars that occurred only once
if [ -z "$1" ]; then
echo "Please specify a directory as the first argument."
exit 1
@stevenh512
stevenh512 / gitconfig-git
Created June 11, 2012 10:51
URL rewriting in .gitconfig
# Use git and git+ssh instead of https
[url "git://github.com/"]
insteadOf = https://github.com/
[url "git@github.com:"]
pushInsteadOf = "git://github.com/"
[url "git@github.com:"]
pushInsteadOf = "https://github.com/"
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->