Skip to content

Instantly share code, notes, and snippets.

@lumynou5
lumynou5 / youtube-commenter-names.user.js
Last active July 14, 2025 03:11
Make YouTube display the names of commenters instead of their handles.
// ==UserScript==
// @name YouTube Commenter Names
// @version 1.7.5
// @description Make YouTube display the names of commenters instead of their handles.
// @author Lumynous
// @license MIT
// @match https://www.youtube.com/*
// @match https://studio.youtube.com/*
// @exclude https://www.youtube.com/persist_identity
// @exclude https://studio.youtube.com/persist_identity

Wayland桌面工作階段會帶來許多問題,其中最常見的就是瀏覽器效能下降的問題。因為有些瀏覽器預設跑在XWayland模式,所以看起來會卡卡的。所以要手動啟用Wayland模式。但是有的瀏覽器啟用Wayland模式反而出現了其他問題,下面就要來討論如何解決這些問題。

下列操作適用Ubuntu 24.04 LTS以上版本的系統。

1. 如何確認自己是使用Wayland工作階段

使用echo $XDG_SESSION_TYPE指令即可得知是目前桌面工作階段x11還是wayland

GNOME 42以上版本預設使用Wayland,登入畫面GDM右下角齒輪會有GNOMEGNOME on Xorg的選項。

React.js Github Repo Spammed

Background

React's official website makes a banner, which offers visitors a way to provide humanitarian aid to Ukraine.
React的官方网站做了一个横幅,为访问者提供了向乌克兰提供人道主义援助的途径。

telegram-cloud-photo-size-5-6127611897286078767-x

Then, many people went to the React.js Github repository and opened lots of spam issues with anti-US and anti-Ukrainian comments in an apparent form of digital protest. The messages are in English and Mandarin.
然后,很多人到React.js Github 仓库中开了很多带有反美国和反乌克兰 issue,进行一种数字化的抗议。这些信息是用英语和普通话写的。

@PierBover
PierBover / Example.svelte
Last active March 25, 2025 19:09
Keep alive Svelte action
<script>
import keepAlive from "./action.js";
import Component from './Component.svelte';
</script>
<div use:keepAlive={{id: 'some-manual-id', componentClass: Component}}/>
@chengsokdara
chengsokdara / useStore.js
Last active June 20, 2024 10:09
React global state in 15 lines of code.
// Author: Sokdara Cheng
// Contact me for web or mobile app development using React or React Native
// https://chengsokdara.github.io
import React, { createContext, useContext, useReducer } from "react";
import initialState from "./initialState"; // object of initial states
import reducer from "./reducer"; // https://reactjs.org/docs/hooks-reference.html#usereducer
const Store = createContext({
dispatch: () => null,
state: initialState,
});
@alexandrebodin
alexandrebodin / index.js
Created February 14, 2020 10:51
Upload image wiht graphql
import React from "react";
import "./App.css";
import { ApolloProvider } from "@apollo/react-hooks";
import gql from "graphql-tag";
import { ApolloClient } from "apollo-client";
import { createUploadLink } from "apollo-upload-client";
import { InMemoryCache } from "apollo-cache-inmemory";
@v1vendi
v1vendi / api_generator.js
Created August 20, 2019 19:19
REST API functional generator
const fetch = (...args) => console.log(...args) // mock
function httpRequest(url, method, data) {
const init = { method }
switch (method) {
case 'GET':
if (data) url = `${url}?${new URLSearchParams(data)}`
break
case 'POST':
case 'PUT':
case 'PATCH':
@gagarine
gagarine / fish_install.md
Last active July 2, 2025 09:47
Install fish shell on macOS Mojave with brew

Installing Fish shell on MacOS (Intel and M1) using brew

Fish is a smart and user-friendly command line (like bash or zsh). This is how you can instal Fish on MacOS and make your default shell.

Note that you need the https://brew.sh/ package manager installed on your machine.

Install Fish

brew install fish

const createLogger = (backgroundColor, color) => {
const logger = (message, ...args) => {
if (logger.enabled === false) {
return;
}
console.groupCollapsed(
`%c${message}`,
`background-color: ${backgroundColor}; color: ${color}; padding: 2px 4px;`,
...args
@tunguskha
tunguskha / Gradient shadow in pure CSS.md
Last active October 12, 2024 17:02
Gradient shadow in pure CSS

Gradient shadow in pure CSS

alt text

HTML
<button>Let's Go !</button>