Skip to content

Instantly share code, notes, and snippets.

@jp311
jp311 / c8c0a01d-e654-4abd-916b-a5d3b2015f3a.json
Created August 18, 2025 01:32
My theme for fcitx5-android
{
"name": "c8c0a01d-e654-4abd-916b-a5d3b2015f3a",
"isDark": true,
"backgroundImage": null,
"backgroundColor": -16777216,
"barColor": -13158601,
"keyboardColor": -16777216,
"keyBackgroundColor": -13750738,
"keyTextColor": -1,
"candidateTextColor": -1,
@jp311
jp311 / Replace-ItemPropertyValue.ps1
Created April 19, 2025 01:20
Batch replaces the values in the registry
<#
.SYNOPSIS
Batch replaces the values in the registry.
#>
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[string] $Path,
[Parameter(Mandatory)]
[string] $Name,
@jp311
jp311 / .emacs
Created February 21, 2025 04:58
My DotEmacs
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(column-number-mode t)
'(default-frame-alist '((fullscreen . maximized)))
'(elfeed-feeds '("https://planet.emacslife.com/atom.xml"))
'(inhibit-startup-screen t)
'(package-archives
@jp311
jp311 / keybindings.json
Last active August 29, 2015 14:20
Emacs in VSCode
[
{ "key": "ctrl+p", "command": "cursorUp",
"when": "editorTextFocus" },
{ "key": "ctrl+n", "command": "cursorDown",
"when": "editorTextFocus" },
{ "key": "ctrl+b", "command": "cursorLeft",
"when": "editorTextFocus" },
{ "key": "ctrl+f", "command": "cursorRight",
"when": "editorTextFocus" },
{ "key": "ctrl+a", "command": "cursorHome",
@jp311
jp311 / Example.cs
Last active December 19, 2015 02:19
模拟微信公众平台群发。
class Program
{
static void Main()
{
var pp = WeChat.PublicPlatform("user", "password");
foreach (var fakeId = pp.GetFakeIds())
{
pp.SendMessage(fakeId, "Hello, world!");
}
}
@jp311
jp311 / code.cs
Created August 22, 2012 09:54
生成 HTML 格式拖拽数据
public static IDataObject CrateHtmlDataObject(string htmlFragment)
{
var header =
@"Version:0.9
StartHTML:{0:00000000}
EndHTML:{1:00000000}
StartFragment:{2:00000000}
EndFragment:{3:00000000}
";
var startHTML =
@jp311
jp311 / code.bat
Created August 22, 2012 09:47
批处理中显示进度
@echo off
setlocal enabledelayedexpansion
set "progress=-\|/"
for /l %%i in (0, 1, 100) do (
REM 取余运算符为 %%,帮助里的 "%" 方式无效
set /a p=%%i %% 4
cls
call set "o=%%progress:~!p!,1%%"
echo Progressing: !o!
REM Handle command