Skip to content

Instantly share code, notes, and snippets.

@k-takata
k-takata / 486-OpenWatcom.md
Last active March 4, 2024 06:43
『はじめて読む486』のサンプルを OpenWatcom でビルドする

『はじめて読む486』のサンプルを OpenWatcom でビルドする

概要

『はじめて読む486』のサンプルプログラム集 をできるだけ簡単に試してみるために、OpenWatcom を使ってビルドしてみました。

※ 16bit 用の無料で使えるコンパイラとしては LSI C-86 試食版が有名ですが、関数の呼び出し規約が MSC や Borland C とは異なっているため、アセンブリプログラムの修正が必須となってしまいます。また、Turbo C 2.01 もありますが、インストールが面倒で TASM も含まれていません。

ダウンロード

@k-takata
k-takata / bash-completion-slowness-on-msys2.md
Created May 13, 2015 15:08
Bash-completion is very slow on MSYS2

Bash-completion is very slow on MSYS2

Bash-completion is very slow on MSYS2 when the current user is a domain user. This describes the cause and the solutions.

Cause

Expansion of ~* is very slow when you use a domain user. For example:

@k-takata
k-takata / grph3.c
Last active January 14, 2024 07:07
A sample program to draw graphics on a command prompt or a dos window
#include <windows.h>
BOOL IsWindows9x()
{
return (GetVersion() >= 0x80000000);
}
int main(int argc, char *argv[])
{
HWND hWnd;
@k-takata
k-takata / 256colors2.bat
Last active November 25, 2023 16:23
Testing ANSI color sequence on Windows 10 and other terminal emulators
@echo off
rem Based on Todd Larason's 256color2.pl.
rem Ported to Windows 10's Command Prompt.
setlocal EnableDelayedExpansion
rem display the colors
rem first the system ones:
echo System colors:
@k-takata
k-takata / envmeter.rb
Last active August 4, 2023 21:31
Temperature, humidity and pressure meter using GR-CITRUS + AE-BME680 + LCD module (AQM1602Y-FLW-FBW)
#!mruby
class LCD
ID = 0x3E
def initialize
@i2c = I2c.new(1)
end
def init
@k-takata
k-takata / bme680.rb
Created July 23, 2023 03:22
Using AE-BME680 with GR-CITRUS
#!mruby
class BME680
ID = 0x77
#REG_COEFF3 = 0x00
REG_FIELD0 = 0x1D
REG_IDAC_HEAT0 = 0x50
REG_RES_HEAT0 = 0x5A
REG_GAS_WAIT0 = 0x64
@k-takata
k-takata / 2002-windows_transparency.diff
Last active February 10, 2023 06:10
Updated for 9.0.1294 and later
# HG changeset patch
# Parent fde93adeda8d91c54211d002010c4476c27e8dcc
# Parent 04bb907f937cefc1a013ccdaa2e54569944b57a8
implement 'transparency' for Windows GUI
diff --git a/src/gui_w32.c b/src/gui_w32.c
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -50,6 +50,13 @@ static int gui_mswin_get_menu_height(int
# define gui_mswin_get_menu_height(fix_window) 0
@k-takata
k-takata / py3-hook-linux.diff
Created December 27, 2022 09:24
Similar patch to 8.2.4317 for Linux
diff --git a/src/errors.h b/src/errors.h
index e33f2e66b..c23aac526 100644
--- a/src/errors.h
+++ b/src/errors.h
@@ -3213,7 +3213,7 @@ EXTERN char e_autoload_import_cannot_use_absolute_or_relative_path[]
EXTERN char e_cannot_use_partial_here[]
INIT(= N_("E1265: Cannot use a partial here"));
#endif
-#if defined(FEAT_PYTHON3) && defined(MSWIN)
+#if defined(FEAT_PYTHON3) && (defined(MSWIN) || defined(__linux__))
@k-takata
k-takata / ln-mingw.sh
Last active May 11, 2022 02:54
Reduce the install size of clang, llvm, lld and gcc on MSYS2
#!/bin/sh
# Convert the same files into hard links to reduce the install size of
# clang, llvm, lld and gcc on MSYS2.
ESC=$'\33'
GREEN="$ESC[32m"
YELLOW="$ESC[33m"
CYAN="$ESC[36m"
RESET="$ESC[m"
@k-takata
k-takata / vim-commit-counts.txt
Last active September 16, 2021 01:02
Vim commit counts and Japanese contributors
2010 年から 2021-09-15 時点までの年ごとのコミット数およびパッチ数ランキング
日本人と思われる人には行頭に * でマーク
2010 7.2.326 - 7.3.094
638 commits
25 (Dominique Pelle)
12 (Lech Lorens)
11 (Sergey Khorev)