Skip to content

Instantly share code, notes, and snippets.

@sindresorhus
sindresorhus / esm-package.md
Last active March 28, 2024 09:11
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.
@wllhf
wllhf / VOClabelcolormap.py
Last active March 28, 2024 09:11
Python implementation of the color map function for the PASCAL VOC data set.
"""
Python implementation of the color map function for the PASCAL VOC data set.
Official Matlab version can be found in the PASCAL VOC devkit
http://host.robots.ox.ac.uk/pascal/VOC/voc2012/index.html#devkit
"""
import numpy as np
from skimage.io import imshow
import matplotlib.pyplot as plt
def color_map(N=256, normalized=False):
@denji
denji / golang-tls.md
Last active March 28, 2024 09:11 — forked from spikebike/client.go
Simple Golang HTTPS/TLS Examples

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@veekaybee
veekaybee / normcore-llm.md
Last active March 28, 2024 09:10
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

Debugging JavaScript with Chrome DevTools

Introduction

This article will delve into the topic of debugging JavaScript with Chrome DevTools. It will provide a comprehensive overview of the process, including theoretical concepts, practical applications, best practices, common pitfalls, and tools and resources to aid in debugging efficiently.

Prerequisites

Before diving into debugging with Chrome DevTools, readers should have a basic understanding of JavaScript programming and be familiar with the Chrome browser.

Main Content

@imba-tjd
imba-tjd / IMBALIST.TXT
Last active March 28, 2024 09:10
🚫 我的uBO屏蔽列表以及HE规则
[Adblock Plus 2.0]
! Title: IMBALIST
! Homepage: https://gist.github.com/imba-tjd/2c9817233ac6798d4f2bfe057f781ca5
! Expires: 10 days
! 使用方法:将 https://gist.githubusercontent.com/imba-tjd/2c9817233ac6798d4f2bfe057f781ca5/raw/IMBALIST.TXT 添加到uBO的规则列表中
! humblebundle领取key页面
www.humblebundle.com##.download-mosaic
www.humblebundle.com##.coupon.whitebox-redux
www.humblebundle.com##.js-subproduct-whitebox-holder > .whitebox-redux
@waylife
waylife / LauncherUtil
Created March 14, 2015 09:42
ShortcutUtil
import java.util.List;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.ProviderInfo;
import android.content.pm.ResolveInfo;
import android.text.TextUtils;
/**
@OrionReed
OrionReed / DOM3D.js
Last active March 28, 2024 09:05
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@mzerging
mzerging / gen_solana_keypair.py
Last active March 28, 2024 09:04
Solana generate Keypair , output public key and 88 bytes base 58 private key string
from solders.keypair import Keypair
import base58
num_keys = 10
for _ in range(num_keys):
keypair = Keypair()
priv_key = keypair.secret()
pub_key = keypair.pubkey()
@kizbitz
kizbitz / dockerhub-v2-api-organization.sh
Last active March 28, 2024 09:04
Get the list of images and tags for a Docker Hub organization account
#!/bin/bash
# Example for the Docker Hub V2 API
# Returns all images and tags associated with a Docker Hub organization account.
# Requires 'jq': https://stedolan.github.io/jq/
# set username, password, and organization
UNAME=""
UPASS=""
ORG=""