使用echo $XDG_SESSION_TYPE
即可得知是x11
還是wayland
。
KDE登入畫面SDDM左下角點選Plasama (Wayland)
工作階段
GNOME 42後已預設使用GNOME,登入時GDM右下角齒輪會有GNOME
與GNOME on Xorg
的選項。
// ==UserScript== | |
// @name YouTube Commenter Names | |
// @version 1.6.6 | |
// @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/* | |
// @noframes | |
// @downloadURL https://gist.github.com/lumynou5/74bcbab54cd9d8fcd3c873fffbac5d3d/raw/youtube-commenter-names.user.js |
React's official website makes a banner, which offers visitors a way to provide humanitarian aid to Ukraine.
React的官方网站做了一个横幅,为访问者提供了向乌克兰提供人道主义援助的途径。
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,进行一种数字化的抗议。这些信息是用英语和普通话写的。
// 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, | |
}); |
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"; |
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': |
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.
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 |
I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6
apt-get update && apt-get install gdb