Skip to content

Instantly share code, notes, and snippets.

View EastSun5566's full-sized avatar
🤔
Hmm

Michael Wang 汪東陽 EastSun5566

🤔
Hmm
View GitHub Profile
@stanley2058
stanley2058 / ui-class-debugger.user.js
Last active April 8, 2025 04:56
Highlight all `ui-` class on a web page
// ==UserScript==
// @name HackMD `ui-` classes highlighter
// @namespace http://hackmd.io/
// @version 0.1.2
// @description Show all `ui-` classes
// @author stanley2058, Yukaii
// @match https://hackmd.io/*
// @match https://local.localhost/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=hackmd.io
// @grant GM.getValue
@Yukaii
Yukaii / README.md
Last active February 14, 2025 17:06
Automated script for launching and retrying Oracle Cloud's Always-Free Tier instance with logging functionality

Script to Launch Always-Free Tier Machine on Oracle Cloud

The instance resource is often at full capacity. Therefore, we should create a script to automatically retry launching the instance at regular intervals.

The script also includes basic logging and will stop launching once you have successfully launched the instance.

Prerequisites

  • jq
  • oci (with correct setup)
@OrionReed
OrionReed / dom3d.js
Last active April 18, 2025 08:15
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; // ¯\\_(ツ)_/¯

How to install game-porting-toolkit (aka proton for macOS)

You also might wanna just use Whisky which does this automatically

This guide works on macOS 13.4+ using Command Line Tools for XCode 15 Beta!

What is this?

In the recent WWDC, Apple announced and released the "game porting toolkit", which upon further inspection this is just a modified version of CrossOver's fork of wine which is a "compatibility layer" that allows you to run Windows applications on macOS and Linux.

@lmiller1990
lmiller1990 / index.html
Created April 15, 2021 15:36
Vanilla FLIP Sundae
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet">
</head>
<body class="m-4">
<button class="bg-gray-300 my-2 px-4 py-2 rounded-md" onclick="flip()">Flip</button>
@sindresorhus
sindresorhus / esm-package.md
Last active April 18, 2025 01:47
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.
@Yukaii
Yukaii / README.md
Last active June 28, 2024 14:02
Editor font & codeblock font cutomization for HackMD

In this tutorial we're going to build a set of parser combinators.

What is a parser combinator?

We'll answer the above question in 2 steps.

  1. What is a parser?
  2. and, what is a parser combinator?

So first question: What is parser?

@aparrish
aparrish / understanding-word-vectors.ipynb
Last active April 9, 2025 14:04
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Rich-Harris
Rich-Harris / service-workers.md
Last active April 7, 2025 10:50
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.