Skip to content

Instantly share code, notes, and snippets.

View kmvan's full-sized avatar
🌏
What is the end and ultimate purpose of the universe?

Km.Van kmvan

🌏
What is the end and ultimate purpose of the universe?
View GitHub Profile
@kJAHsin
kJAHsin / google-chrome-apt-install.md
Last active May 19, 2025 08:36
Install Google Chrome in Ubuntu Linux with apt

Installing Google Chrome via APT

Note: This is an updated installation method for Google Chrome, as the previous apt-get approach has been deprecated. Note: sh file is attached.

1. Set Up the Google Signing Key and Repository

Add Google’s public signing key and set up the APT repository for Google Chrome:

curl -fsSL https://dl.google.com/linux/linux_signing_key.pub | sudo gpg --dearmor -o /usr/share/keyrings/google-chrome.gpg
@kmvan
kmvan / _document.tsx
Created June 2, 2022 02:52
Next 12 + React 18 _document.tsx
import Document, {
DocumentContext,
Head,
Html,
Main,
NextScript,
} from 'next/document'
import { CSSProperties, ServerStyleSheet } from 'styled-components'
import { AppContextProps } from 'YOUR APP CONTEXT'
interface PageDocumentProps {
@sindresorhus
sindresorhus / esm-package.md
Last active July 2, 2025 19:35
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.
@Aloxaf
Aloxaf / fcitx5-diagnose.sh
Created July 4, 2020 02:20
实验性的 fcitx-diagnose for fcitx5
#!/usr/bin/env bash
shopt -s extglob nullglob globstar
export TEXTDOMAIN=fcitx5
__test_bash_unicode() {
local magic_str='${1}'$'\xe4'$'\xb8'$'\x80'
local magic_replace=${magic_str//\$\{/$'\n'$\{}
! [ "${magic_str}" = "${magic_replace}" ]
}

Using JSDOC-Based TypeScript

Get Started

Choose your editor

  • WebStorm, Rider
    • Partial support, not enough intelli hints
    • Toggle on TypeScript language service
  • VSCode
@SoftCreatR
SoftCreatR / README.md
Last active April 25, 2021 11:24
ImageMagick® 7 for Debian/Ubuntu.
@nyaapass
nyaapass / npmrc.taobao
Created January 17, 2018 01:42
使用淘宝源的 npmrc 配置文件
loglevel=http
progress=false
registry=https://registry.npm.taobao.org
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
phantomjs_cdnurl=https://npm.taobao.org/mirrors/phantomjs/
electron_mirror=https://npm.taobao.org/mirrors/electron/
chromedriver_cdnurl=https://npm.taobao.org/mirrors/chromedriver/
@bynil
bynil / config-git-proxy.txt
Last active April 30, 2025 00:27
Use git over socks5 proxy
Port: 1080
1. Create a file /YOUR PATH/gitproxy.sh with content:
#!/bin/sh
nc -X 5 -x 127.0.0.1:1080 "$@"
2. Edit your ~/.gitconfig
# For git://
@hartzis
hartzis / EventComponent.js
Last active November 29, 2023 16:38
Touch Event Handling React Component
import React from 'react';
export default class EventComponent extends React.Component {
constructor(props) {
super(props);
this._onTouchStart = this._onTouchStart.bind(this);
this._onTouchMove = this._onTouchMove.bind(this);
this._onTouchEnd = this._onTouchEnd.bind(this);
@bramus
bramus / .htaccess
Last active August 16, 2024 06:02
URL Rewriting for Apache (requires mod_rewrite) and IIS (requires IIS url rewrite module)
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]