Skip to content

Instantly share code, notes, and snippets.

View sekika's full-sized avatar

Katsutoshi Seki (関 勝寿) sekika

View GitHub Profile
@sekika
sekika / print_long.py
Last active August 8, 2024 15:13
print_long - Print long text with pypager
# print_long - Print long text with pypager
#
# Requirement: pypager package
#
# This script provides a function to display long text in a paginated manner using the pypager package.
# If the text fits within a single page, it will be printed directly to the console. If the text spans
# multiple pages, it will be displayed using pypager to allow for easy navigation through the content.
#
# Usage:
# 1. Ensure you have pypager installed:
@sekika
sekika / Makefile
Created May 16, 2024 19:14
for jekyll Docker
port = 5555
url = http://localhost:$(port)/
container = jekyll
image = $(container):1.0
repo = /Users/seki/git/sekika.github.io
www = /jekyll
mount = --mount type=bind,source=$(repo),destination=$(www)
all:
cat Readme.md
@sekika
sekika / entrypoint.sh
Created May 16, 2024 19:11
for jekyll Dockerfile
#!/bin/sh
cd /jekyll
rm -f Gemfile.lock
bundle install
bundle update --bundler
bundle exec jekyll serve --drafts --host 0.0.0.0
@sekika
sekika / Dockerfile
Created May 16, 2024 19:04
Dockerfile for jekyll
FROM ruby:alpine
# Install package
RUN apk update && apk --no-cache upgrade && \
apk add --no-cache build-base
# Copy entrypoint script and set permissions
COPY entrypoint.sh /bin/entrypoint.sh
RUN chmod +x /bin/entrypoint.sh
@sekika
sekika / concatepdf.py
Last active June 6, 2024 08:11
Concatenate PDF images with multiple images on a single page
#!/usr/bin/env python3
"""Concatenate PDF images with multiple images on a single page
This is a Python script designed to concatenate PDF images into
a single file. The script arranges multiple PDF images both
horizontally and vertically on a single page, allowing for
customizable image counts along each axis. This results in
multiple pages being generated.
In stalled required library by the following command:
import discord
class Client(discord.Client):
async def on_ready(self):
if hasattr(self, 'action'):
for action in self.action:
if action[0] == 1:
user = await self.fetch_user(action[1])
syntax on
set autoindent
set expandtab
let _curfile=expand("%:r")
if _curfile == 'Makefile'
set noexpandtab
endif
set tabstop=4
set shiftwidth=4
set cursorline
@sekika
sekika / password.html
Last active May 15, 2017 20:24
パスワード生成プログラム (JavaScript 版)
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>パスワード</title>
<style type="text/css">
fieldset {
@sekika
sekika / password.py
Last active May 17, 2017 13:59
パスワード生成プログラム
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# パスワード生成プログラム
#
# このプログラムに関する記事「パスワードの管理について」
# https://sekika.github.io/2017/05/09/Password/
#
# 使い方:プログラムのソースコードに直接サイト情報を書く。
# サイト情報は、サイト名、ハッシュ関数、文字種、文字数、パスワードの種の5つ。
@sekika
sekika / primequiz.py
Last active May 9, 2017 18:36
Primality quiz
#!/usr/bin/env python3
# Primality quiz
# Use the commandline argument "p" to show the list
#
# http://sekika.github.io/2016/12/13/Primality/
### Parameters
rep=10 # Numbers of questions