Skip to content

Instantly share code, notes, and snippets.

Avatar
🥋
夏来にけらし白妙の

Goto Hayato gh640

🥋
夏来にけらし白妙の
View GitHub Profile
@gh640
gh640 / cookie_with_puppeteer.js
Created Jul 22, 2021
Sample: Use cookie with Puppeteer
View cookie_with_puppeteer.js
@gh640
gh640 / Dockerfile
Created Jun 20, 2021
サンプル: Debian 10 (buster) で言語設定を UTF-8 で日本語にする
View Dockerfile
FROM debian:buster
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
locales && \
rm -rf /var/lib/apt/lists/*
RUN localedef -f UTF-8 -i ja_JP ja_JP.UTF-8
@gh640
gh640 / use_different_debugger_with_python3.sh
Last active Jun 20, 2021
Running IPython or bpython with `breakpoint()` on Python 3
View use_different_debugger_with_python3.sh
#!/usr/local/bin/bash
# Use IPython.
PYTHONBREAKPOINT=IPython.terminal.debugger.set_trace python myscript.py
# Use bpython.
PYTHONBREAKPOINT=bpdb.set_trace python myscrippt.py
@gh640
gh640 / local.yml
Created Jun 16, 2021
Sample: Ansible inventory for localhost
View local.yml
---
all:
hosts:
localhost:
ansible_host: localhost
ansible_connection: local
ansible_python_interpreter: '{{ ansible_playbook_python }}'
@gh640
gh640 / github_cli_fetch_title.sh
Last active May 11, 2021
Fetching GitHub issue title wth GitHub CLI
View github_cli_fetch_title.sh
# Fetch issue title
gh issue view --json title -q '.title' [issue id]
# Add alias
gh alias set it 'issue view --json title -q ".title"'
# Use the alias
gh it [issue id]
@gh640
gh640 / Dockerfile
Last active May 4, 2021
Sample: unoconv Docker image based on debian:buster
View Dockerfile
# DIST can be debian:buster-slim
ARG DIST=debian:buster
FROM $DIST
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends unoconv && \
apt-get clean && \
@gh640
gh640 / dockerfile-user-addition.md
Last active May 3, 2021
(Japanese) Dockerfile ユーザーの追加方法まとめ
View dockerfile-user-addition.md

Dockerfile ユーザーの追加方法まとめ

共通の前提

以下のパラメータが設定されているものとします。

@gh640
gh640 / seq.sh
Created May 2, 2021
Samples: `seq` command
View seq.sh
# Normal
seq 1 5
# 1
# 2
# 3
# 4
# 5
seq 5 1
# 5
@gh640
gh640 / card.js
Created Apr 25, 2021
Sample: Send a message on Google Chat with Node `axios`
View card.js
const axios = require(`axios`)
// Pass incoming webhook URL with environment variable `WEBHOOK_URL`.
const WEBHOOK_URL = process.env.WEBHOOK_URL
const title = `Hi`
const subtitle = `Hello`
const paragraph = `Hasta La Vista, Baby.`
const widget = { textParagraph: { text: paragraph } }
axios.post(WEBHOOK_URL, {
@gh640
gh640 / send_message_on_google_chat.py
Created Apr 20, 2021
Sample: Send a message on Google Chat group with Python `requests`
View send_message_on_google_chat.py
"""A sample to send message on Google Chat group with Python requests.
Prerequisites:
- Google API v1
- A webhook URL taken
Usage:
```bash