Skip to content

Instantly share code, notes, and snippets.

View Eason0210's full-sized avatar
🎯
Focusing

Eason Huang Eason0210

🎯
Focusing
View GitHub Profile
@Eason0210
Eason0210 / build.org
Created November 3, 2024 03:27 — forked from LdBeth/build.org
Build Emacs 31 for Windows

Build Emacs with MSYS2

This document is an up-to-date guide on compile Emacs 31 on windows with MSYS2, and make a installation with native compile that can work without MSYS2.

The idea is after get a working Emacs, you may delete MSYS2 environment to save some disk space, and forget about rebuilding Emacs until the next time you feel need to, without need figuring out everything again.

@Eason0210
Eason0210 / repeat-change-cursor-color.el
Created June 14, 2024 14:16 — forked from jdtsmith/repeat-change-cursor-color.el
Emacs: change cursor color during active repeat-mode commands
(let ((orig (default-value 'repeat-echo-function))
rcol ccol in-repeat)
(setq
repeat-echo-function
(lambda (map)
(if orig (funcall orig map))
(unless rcol (setq rcol (face-foreground 'error)))
(if map
(unless in-repeat ; new repeat sequence
(setq in-repeat t
@Eason0210
Eason0210 / emacs-29.0.92-2bad582-build-log.txt
Created June 21, 2023 05:14
emacs-29.0.92-2bad582-build-log
MINGW64 ~/src/emacs-29
$ ./autogen.sh
Checking whether you have the necessary tools...
(Read INSTALL.REPO for more details on building Emacs)
Checking for autoconf (need at least version 2.65) ... ok
Your system has the required tools.
Building aclocal.m4 ...
Running 'autoreconf -fi -I m4' ...
ac-wrapper: autoreconf: warning: auto-detected versions not found ( ); falling back to latest available
You can now run './configure'.
@Eason0210
Eason0210 / emacs-29.0.92-native-compilation-log.txt
Created June 19, 2023 13:12
Build Emacs 29.0.92--with-native-complilation=aot
MINGW64 ~/src
$ tar xJf emacs-29.0.92.tar.xz
MINGW64 ~/src
$ cd emacs-29.0.92/
MINGW64 ~/src/emacs-29.0.92
$ ls
aclocal.m4 ChangeLog config.bat doc INSTALL.REPO lwlib modules README
admin ChangeLog.1 configure etc leim m4 msdos site-lisp
[internal] Sat Jun 17 21:04:15 2023:
(:message "Running language server: /Users/aqua0210/.nvm/versions/node/v19.6.0/bin/pyright-langserver --stdio")
[client-request] (id:1) Sat Jun 17 21:04:15 2023:
(:jsonrpc "2.0" :id 1 :method "initialize" :params
(:processId 79724 :rootPath "/Users/aqua0210/Code/Python/django-project/" :rootUri "file:///Users/aqua0210/Code/Python/django-project" :initializationOptions #s(hash-table size 1 test eql rehash-size 1.5 rehash-threshold 0.8125 data
())
:capabilities
(:workspace
(:applyEdit t :executeCommand
(:dynamicRegistration :json-false)
@Eason0210
Eason0210 / run-psql.ps1
Created June 13, 2023 05:18 — forked from MasFlam/run-psql.ps1
PowerShell script to run psql prompting for connection details
Write-Host "Enter connection details:"
$server = "localhost"
$server_maybe = (Read-Host -Prompt "Server [$server]")
If($server_maybe -ne "") {
$server = $server_maybe
}
$db = "postgres"
@Eason0210
Eason0210 / how-to.txt
Created November 11, 2022 15:23 — forked from simonw/how-to.md
How to create a tarball of a git repository using "git archive"
git archive --format=tar.gz -o /tmp/my-repo.tar.gz --prefix=my-repo/ master
@Eason0210
Eason0210 / nix-on-macos-catalina.md
Created September 22, 2021 15:19 — forked from chriselsner/nix-on-macos-catalina.md
Nix on macOS Catalina

Nix on macOS Catalina

I'm writing this gist for my own records but it might help someone else too.

Installing Nix

Support for Catalina has improved a lot since the update was first rolled out.

Note: See the NixOS manual for discussion of the --darwin-use-unencrypted-nix-store-volume option.

# Instructions for fresh install
$ sh <(curl -L https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume --daemon
# reboot
$ source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
$ echo 'export NIX_PATH=darwin-config=$HOME/.nixpkgs/darwin-configuration.nix:$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH' | tee -a ~/.zshrc
$ echo 'source $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh' | tee -a ~/.zshrc
$ nix-channel --add https://nixos.org/channels/nixpkgs-unstable
$ nix-channel --add https://github.com/LnL7/nix-darwin/archive/master.tar.gz darwin
$ nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
<html>
<head>
<HTA:APPLICATION Icon="C:\test.ico"/>
<TITLE>Distance</TITLE>
</head>
<script language="VBScript">
Sub Window_Onload
On Error Resume Next
Set x = document.getElementById("div1")
Height = x.offsetHeight + 80