Skip to content

Instantly share code, notes, and snippets.

@vogler
vogler / clean-url-readme-tab.github.com.tamper.js
Last active April 5, 2024 10:51
GitHub: remove `?tab=readme-ov-file` from URL
// ==UserScript==
// @name GitHub: remove `?tab=readme-ov-file` from URL
// @description GitHub: remove `?tab=readme-ov-file` from URL
// @namespace https://gist.github.com/vogler
// @downloadURL https://gist.github.com/vogler/74edff6de37c3a13eeff8c99c6bed910/raw/clean-url-readme-tab.github.com.tamper.js
// @version 0.1
// @author Ralf Vogler
// @match https://github.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=github.com
// @grant none
@b0gdanw
b0gdanw / DisableBigSur.sh
Last active March 29, 2024 09:50
Disable Big Sur services
#!/bin/zsh
#Credit: Original idea and script disable.sh by pwnsdx https://gist.github.com/pwnsdx/d87b034c4c0210b988040ad2f85a68d3
#Disabling unwanted services on macOS 11 Big Sur (11) and macOS Monterey (12)
#Disabling SIP is required ("csrutil disable" from Terminal in Recovery)
#Modifications are written in /private/var/db/com.apple.xpc.launchd/ disabled.plist and disabled.501.plist
# user
TODISABLE=()
@fatso83
fatso83 / NOTES.md
Created October 9, 2021 07:31
Installing Vagrant on Apple Silicon Macs (M1, M1X, etc)

VirtualBox only supports the x86 platform, so the default installation instructions for Vagrant does not work on Apple silicon. Thankfully Vagrant has a VMWare Provider (more on providers here), and so if I can get VMWare running on my M1 MacBook, I should be able to run Vagrant as well!

These are my notes during figuring this out.

Get the VMWare Tech Preview released in September 2021!

We are in luck, as VMWare released this just a few weeks ago.

  • See [their blog entry][1]
@sarthakpranesh
sarthakpranesh / cleanMacVMs.sh
Last active March 30, 2024 22:29
Debloat Mac OS ( use at your own risk )
# I use MacOS VMs from github for iOS development.
# By no suprise they are a bit slow and have a lot of things I don't use
# Hence this script for lighter and better VM for my iOS development and builds
# GUI and animation related things to tweak
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false
defaults write NSGlobalDomain NSWindowResizeTime -float 0.001
defaults write -g QLPanelAnimationDuration -float 0
defaults write com.apple.dock autohide-time-modifier -float 0
defaults write com.apple.dock launchanim -bool false
sudo sysctl debug.lowpri_throttle_enabled=0
@sindresorhus
sindresorhus / esm-package.md
Last active April 25, 2024 08:14
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@lilydjwg
lilydjwg / colors.py
Last active February 22, 2024 12:48
colors.py: show all kinds of terminal colors at a glance
#!/usr/bin/python3
from functools import partial
def colors16():
for bold in [0, 1]:
for i in range(30, 38):
for j in range(40, 48):
print(f'\x1b[{bold};{i};{j}m {bold};{i};{j} |\x1b[0m', end='')
print()
@lomafor
lomafor / disable.sh
Last active December 7, 2022 19:37
Disable bunch of #$!@ in Catalina
#!/bin/bash
## HOW TO RUN
#
# 1. Enter Recovery mode w. CMD+R
# 2. cd /Volumes/Macintosh\ HD
# 3. sh /Volumes/Macintosh\ HD/Users/disable.sh
## LOCATIONS
#
@david-zw-liu
david-zw-liu / remove_old_builds.sql
Last active January 4, 2024 06:31
Keep 1000 builds per repos for DroneCI (sqlite3 version >= 3.25 required)
-- Thank @sbengo to figure out foreign_keys constraints is defaults to false in sqlite
-- Enable to delete logs by cascading delete
PRAGMA foreign_keys = ON;
WITH n_build_ids_per_repo as (
SELECT build_id
FROM (
SELECT
build_id,
build_repo_id,
@ponimas
ponimas / mojave.sh
Last active August 17, 2023 17:02
disable unnecessary mojave services
# Disable / Enable Dashboard
# Settings / Mission control / Dashboard (selector) - Off
# or
# completely disable:
defaults write com.apple.dashboard mcx-disabled -boolean YES; killall Dock
# enable again:
#defaults write com.apple.dashboard mcx-disabled -boolean NO; killall Dock
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false
defaults write NSGlobalDomain NSWindowResizeTime -float 0.001
@jakub-g
jakub-g / async-defer-module.md
Last active April 12, 2024 07:32
async scripts, defer scripts, module scripts: explainer, comparison, and gotchas

<script> async, defer, async defer, module, nomodule, src, inline - the cheat sheet

With the addition of ES modules, there's now no fewer than 24 ways to load your JS code: (inline|not inline) x (defer|no defer) x (async|no async) x (type=text/javascript | type=module | nomodule) -- and each of them is subtly different.

This document is a comparison of various ways the <script> tags in HTML are processed depending on the attributes set.

If you ever wondered when to use inline <script async type="module"> and when <script nomodule defer src="...">, you're in the good place!

Note that this article is about <script>s inserted in the HTML; the behavior of <script>s inserted at runtime is slightly different - see Deep dive into the murky waters of script loading by Jake Archibald (2013)