Skip to content

Instantly share code, notes, and snippets.

@sindresorhus
sindresorhus / esm-package.md
Last active July 15, 2024 20:29
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.
@BrychanOdlum
BrychanOdlum / storefrontmappings.json
Last active July 15, 2024 20:27
Apple iTunes Storefront IDs
[
{
"name": "Algeria",
"code": "DZ",
"storefrontId": 143563
},
{
"name": "Angola",
"code": "AO",
"storefrontId": 143564
@ThioJoe
ThioJoe / Get_All_Shell_Folder_Shortcuts.ps1
Last active July 15, 2024 20:26
Fetches all shell folders from Windows Registry and creates a shortcut to each, while attempting to determine the proper name and icon. Also outputs CSV file with results.
# Get All Shell Folder Shortcuts Script
# https://gist.github.com/ThioJoe/16eac0ea7d586c4edba41b454b58b225
# How to Use:
# 1. Open powershell, and navigate to the path with the script using 'cd' command
# 2. Run the following command to allow running scripts for the current session:
# Set-ExecutionPolicy -ExecutionPolicy unrestricted -Scope Process
# 3. Without closing the powershell window, run the script by typing the name of the script file starting with .\ for example:
# .\Get_All_Shell_Folder_Shortcuts.ps1
# 4. Wait for it to finish, then look in the "Shell Folder Shortcuts" folder for the results
@chriseidhof
chriseidhof / sample.swift
Last active July 15, 2024 20:26
View Inspection
import SwiftUI
struct SizeKey: PreferenceKey {
static func reduce(value: inout CGSize?, nextValue: () -> CGSize?) {
value = value ?? nextValue()
}
}
struct ContentView: View {
@State var width: CGFloat? = nil
var body: some View {
@kevsmith
kevsmith / productivity.md
Last active July 15, 2024 20:26
Elon Musk's Productivity Tips

Progress, Precision and Profit

[...removed Tesla-specific commentary...]

Btw, here are a few productivity recommendations:

  • Excessive meetings are the blight of big companies and almost always get worse over time. Please get rid of all large meetings, unless you’re certain they are providing value to the whole audience, in which case keep them very short.

  • Also get rid of frequent meetings, unless you are dealing with an extremely urgent matter. Meeting frequency should drop rapidly once the urgent matter is resolved.

@JustTalDevelops
JustTalDevelops / client_blob_cache_exploit.md
Last active July 15, 2024 20:26
Exploiting the Blob Cache in Bedrock Edition

Exploiting the Blob Cache in Minecraft: Bedrock Edition

...and why it matters.

Preface

You might have seen my HiveCorruptor plugin on Poggit. To be clear, I don't have a vendetta against The Hive or anything like that, the plugin was more so a comedic demonstration of how the blob cache can be exploited to crash clients. The next thing you're probably thinking is "how the hell does this work?" - and this is what this article will go over.

Introduction

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@PhotonQuantum
PhotonQuantum / gen_ctags.sh
Created July 15, 2024 20:20
Coq ctags generation snippet.
#!/usr/bin/env bash
set -euo pipefail
COMPCERT_SRC=~/temp/CompCert-3.7
CTAGS_DEFINITION=/Users/lightquantum/.config/coq.ctags
# Generate tags for Compcert + stdlib + all files under cwd
IFS=" " read -r -a loadpath <<< "$(echo 'Print LoadPath.' | coqtop 2>/dev/null | python loadpath.py)"
find . ${loadpath[@]} $COMPCERT_SRC -type f -name "*.v" -print0 | xargs -0 ctags --options=$CTAGS_DEFINITION
@tinogomes
tinogomes / DNS_TO_LOCALHOST.markdown
Last active July 15, 2024 20:24
Public DNS Pointing to localhost (127.0.0.1)

Available Public Wildcard DNS Domains pointing to localhost (127.0.0.1)

The best way to safely and securely use local domains pointing to 127.0.0.1 is to edit your local settings (/etc/hosts) and add your own settings. Keep in mind if you want to use subdomains, you need to enter all variations.

Example:

# Adding bottom of your current file /etc/hosts
################# MY LOCAL DOMAINS
127.0.0.1 local.com admin.local.com
127.0.0.1 domain1.com
@TheSunCat
TheSunCat / DisblockOrigin.theme.css
Last active July 15, 2024 20:24
Hide all Nitro & Boost upsells in Discord!
/**
* @name Adblock for Discord
* @author TheSunCat and contributors
* @version 1.0.0
* @description Hide all Nitro & Boost upsells on Discord!
* @source https://gist.github.com/TheSunCat/58fedaa19d6154ef3e4b2b676c286906
*/
/* ------------------ */
/* Hide Nitro upsells */