Skip to content

Instantly share code, notes, and snippets.

View WhiteCat6142's full-sized avatar
:octocat:

K.O. WhiteCat6142

:octocat:
  • Titech->U-Tokyo (master)
  • Tokyo,Japan
View GitHub Profile
EARLYOOM_ARGS="-r 0 -m 7,1 -s 10 --prefer '^(Web Content|Isolated Web Co)$' --avoid '^(firefox|dnf|packagekitd|gnome-shell|gnome-session-c|gnome-session-b|lightdm|sddm|sddm-helper|gdm|gdm-wayland-ses|gdm-session-wor|gdm-x-session|Xorg|Xwayland|systemd|systemd-logind|dbus-daemon|dbus-broker|cinnamon|cinnamon-sessio|kwin_x11|kwin_wayland|plasmashell|ksmserver|plasma_session|startplasma-way|xfce4-session|mate-session|marco|lxqt-session|openbox)$'"
# https://ideone.com/BLQ2FM
# https://blog.tmtms.net/entry/2015/12/07/mime-header-encoding
# https://docs.python.org/ja/3/library/email.message.html
from email.message import Message
from email.header import Header
msg = Message()
h = Header('MIMEヘッダエンコーディングは複雑すぎてつらい', 'utf-8',77,'Subject')
msg['Subject'] = h.encode()
print(msg.as_string())
#!/usr/bin/python
import gi
gi.require_version('Notify', '0.7')
from gi.repository import Notify
Notify.init ("Hello world")
Hello = Notify.Notification.new ("Hello world","This is an example notification.","dialog-information")
Hello.show ()
#!/usr/bin/env python
import gi
gi.require_version("Gtk", "4.0")
from gi.repository import Gtk
from gi.repository import WebKit2
from gi.repository import GLib
# https://stackoverflow.com/questions/42174933/python-web-browser-disable-javascript
# Python Web Browser: Disable Javascript? - Stack Overflow
# https://wiki.gnome.org/Projects/Vala/WebKitSample
@WhiteCat6142
WhiteCat6142 / Nostr-autoComplete.html
Last active July 16, 2023 03:48
Nostr-autoComplete
<!DOCTYPE html>
<html lang="ja">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Nostr補完</title>
<link rel="stylesheet"
/*
MIT License
Copyright (c) 2024 WhiteCat6142
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is