Skip to content

Instantly share code, notes, and snippets.

View revolter's full-sized avatar
💭
Name pronunciation: U-lee-ahn

Iulian Onofrei revolter

💭
Name pronunciation: U-lee-ahn
View GitHub Profile
@aravindanve
aravindanve / bypass-disable-devtool.md
Last active March 2, 2025 01:22
Bypass disable-devtool

(Working as of 2025-02-09)

There are websites that use disable-devtool to prevent you from opening or using devtools. They typically prevent you from right clicking or using the shortcut to open devtools. Even if you successfully do so, they detect it and redirect you elsewhere. You can bypass this by using one of the following ways.

Opening devtools

If the shortcut F12 on Windows or Option + ⌘ + I on Mac do not work. Press the three vertically aligned dots in the top right corner of your Google Chrome or Microsoft Edge window. Under the section "More Tools", you'll see the option to select "Developer Tools" which opens the toolkit in your window.

@keenahn
keenahn / git-default-branch.sh
Last active November 16, 2023 10:21
A simple bash script to check if the default branch is main or master for a given repo
#!/bin/bash
# Check if the remote 'origin' has a 'main' branch
if git show-branch remotes/origin/main > /dev/null 2>&1; then
echo "main"
else
echo "master"
fi
@TheSherlockHomie
TheSherlockHomie / RenewExpiredGPGkey.md
Created January 3, 2021 16:36
Updating expired GPG keys and backing them up 🔑🔐💻

Updating expired GPG keys and their backup 🔑🔐💻

I use a GPG key to sign my git commits.

An error like this one might be a sign of an expired GPG key.

error: gpg failed to sign the data fatal: failed to write commit object
@samvrlewis
samvrlewis / longest-git-commit-message
Last active January 18, 2024 12:48
Get the longest git commit messages
git rev-list --no-merges "${1:-HEAD}" | while read rev; do echo "$(git show -s --format='%b' $rev | wc -w) words: $rev"; done | sort -rn | head -6 | cut -f2 -d: | xargs -I{} git rev-list --pretty=medium {} --max-count=1
@zbeekman
zbeekman / GH-CF-strict-SSL-w-CDN.md
Last active December 4, 2024 07:02
Setting up GH-pages with custom domain, strict (end-to-end) SSL with CloudFlare DNS & CDN

Custom domains, GH-pages, Cloudflare and strict SSL end-to-end encryption

Why I wrote this

Before Github supported SSL encryption for github pages sites, many people were using CloudFlare (CF) as their DNS provider and CDN proxy. CF allowed users to enable SSL encryption from the CDN end points/proxies to the end user. This was great and it allowed visitors to your website to connect with a secure connection between their browser and the cloudflare CDN box that was serving your content. However, with this setup one (significant) link in the chain remained unencrypted and

@mohanpedala
mohanpedala / bash_strict_mode.md
Last active March 2, 2025 12:06
set -e, -u, -o, -x pipefail explanation
@paolocarrasco
paolocarrasco / README.md
Last active February 10, 2025 15:41
How to understand the `gpg failed to sign the data` problem in git

Problem

You have installed GPG, then tried to commit and suddenly you see this error message after it:

error: gpg failed to sign the data
fatal: failed to write commit object

Debug

@mdonkers
mdonkers / server.py
Last active February 28, 2025 21:59
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
@judy2k
judy2k / parse_dotenv.bash
Created March 22, 2017 13:34
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
@algal
algal / ScaleAspectFitImageView.swift
Last active September 24, 2023 10:19
UIImageView subclass that works with Auto Layout to express its desired aspect ratio
import UIKit
// known-good: Xcode 8.2.1
/**
UIImageView subclass which works with Auto Layout to try
to maintain the same aspect ratio as the image it displays.
This is unlike the usual behavior of UIImageView, where the