Skip to content

Instantly share code, notes, and snippets.

@nogajun
nogajun / app.py
Created December 29, 2022 10:48
Flaskでカレンダーを表示する
@app.route('/calendar')
def month_list():
dt_now = datetime.now()
month = calendar.monthcalendar(dt_now.year,dt_now.month)
return render_template("calendar.html", month = month)
@nogajun
nogajun / Dockerfile
Last active September 6, 2022 00:39
For web app creation class. used from dev container on Visual studio code.
FROM debian:bookworm
LABEL version="1.2"
LABEL maintainer="nogata@gm.himeji-du.ac.jp"
LABEL description="For web app creation class. used from dev container on Visual studio code."
# 必要なパッケージをインストール
RUN apt-get -y update && \
apt-get -y full-upgrade && \
apt-get -y install apt-utils locales sudo python3-all python3-pip python3-venv python-is-python3 python3-yaml bash-completion wget curl jq git task-japanese
@nogajun
nogajun / tmx2tsv.xsl
Last active November 19, 2022 04:33
xsltprocを使って翻訳メモリのtmxファイルをcsvに変換するXSLTファイル
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" encoding="utf-8" />
<xsl:template match="/">
<xsl:text>"en-US"&#x9;"ja"</xsl:text>
<xsl:text>&#xA;</xsl:text>
<xsl:for-each select="tmx/body/tu">
<xsl:text>"</xsl:text>
<xsl:value-of select="tuv[@lang='en-US']/seg"/>
<xsl:text>"&#x9;"</xsl:text>
@nogajun
nogajun / dynamite-color.gpl
Created September 21, 2020 01:51
BTS Dynamite logo color palette for GIMP/LibreOffice
GIMP Palette
Name: Dynamite
Columns: 12
#
226 7 68
64 181 207
211 116 151
115 172 123
103 33 124
240 103 6
@nogajun
nogajun / ms_ui_strings_csv_cleanup.sh
Created December 15, 2019 03:37
MicrosoftランゲージポータルにあるUI訳語データCSVがまともなCSVじゃないのでクリーンアップしてCSVとして使えるようにするワンライナー
sed -e '1,12d' -e 's/",,"/\t/g' -e 's/^"//g' -e 's/"$//g' ja-JP-csv-Excel.csv > a.csv
@nogajun
nogajun / JYS-NS138.md
Last active March 10, 2024 17:14
JYS-NS138 Controler Instruction Sheet

Operating Instructions:

1.Mode and connection instructions

The Mode Switch:

Press Y + Home 2 seconds to enter the Bluetooth search mode, led1-led4 running horse flashes, and the LED channel corresponding to the successful connection remains on (Switching the assignment of the host organization); Synchronous state, or being paired with host connection: led1-led4 flashing horse;

Note: when the handle enters synchronization mode, it will automatically go to sleep if no synchronization is reached within 2.5 minutes.

---
- hosts: all
become: yes
vars:
user: "{{ ansible_ssh_user }}"
home_dir: "/home/{{ user }}"
fontconfig: "{{ home_dir }}/.config/fontconfig"
gtk3: "{{ home_dir }}/.config/gtk-3.0"
tasks:
- name: ロケール関係インストール
@nogajun
nogajun / dummy-largefile.sh
Created September 19, 2019 03:32
320x419164のcsvファイルを作るワンライナー
t=$(echo -n "1"; for i in {2..320}; do echo -n ",$i"; done;); for i in {1..419164}; do echo $t ;done > dummy-largefile.csv
@nogajun
nogajun / shutter.yml
Created December 7, 2018 09:37
スクリーンショットツールShutterをAppImage化するレシピ
app: shutter
binpatch: true
ingredients:
dist: stretch
packages:
- libxml-sax-expat-perl
- libimage-exiftool-perl
- libnet-dbus-glib-perl
- libgoo-canvas-perl
@nogajun
nogajun / wine-japanese.reg
Last active December 18, 2023 12:12
LinuxのWine環境で日本語周りをいい感じに設定するレジストリデータ。Windowsで使われるフォント名置換とビットマップフォント無効、InputStyleをrootにします
Windows Registry Editor Version 5.00
' 文字コードをUTF-16リトルエンディアン、改行をCR+LFで保存してください
[HKEY_CURRENT_USER\Software\Wine\Fonts\Replacements]
"Meiryo UI"="Noto Sans CJK JP"
"Meiryo"="Noto Sans CJK JP"
"MS Gothic"="Ume Gothic"
"MS Mincho"="Ume Mincho"
"MS PGothic"="Ume P Gothic"