Skip to content

Instantly share code, notes, and snippets.

View sawa2d2's full-sized avatar
👾

sawa sawa2d2

👾
View GitHub Profile
# site-packages に .pth を1枚だけ設置(これで import 可能に)
install -d %{buildroot}%{python3_sitelib}
cat > %{buildroot}%{python3_sitelib}/%{srcname}.pth <<'EOF'
%{customdir}
EOF
#!/bin/bash
find_git_root() {
dir="${1:-$PWD}"
while [ "$dir" != "/" ]; do
if [ -e "$dir/.git" ]; then
echo "$dir"
return 0
fi
dir="$(dirname "$dir")"
@sawa2d2
sawa2d2 / README.md
Last active May 26, 2025 01:57
dummy

Controller

Start the systemd daemon:

sudo systemctl daemon-reload
sudo systemctl start user-api.service
sudo systemctl enable user-api.service

Access to the endpoint:

@sawa2d2
sawa2d2 / .md
Created May 25, 2025 22:27
extract pxe resources from a bootable usb

Specify the USB device

lsblk

Mount the device

sudo mkdir -p /mnt/usb
sudo mount /dev/sdb1 /mnt/usb
@sawa2d2
sawa2d2 / index.js
Created September 1, 2024 11:09
GraphQL with axios
import React, { useState, useEffect } from 'react';
import axios from 'axios';
const HelloComponent = () => {
const [helloMessage, setHelloMessage] = useState('Loading...');
useEffect(() => {
const fetchData = async () => {
try {
const graphqlQuery = {
import requests
# GitHub APIトークンとリポジトリ情報
GITHUB_TOKEN = 'your_github_token'
REPO_OWNER = 'your_owner_name'
REPO_NAME = 'your_repo_name'
HEADERS = {'Authorization': f'token {GITHUB_TOKEN}'}
# 特定のバージョン間でマージされたPRを取得
def get_merged_prs(base_branch='main'):
Name: example-package
Version: 1.0
Release: 1%{?dist}
Summary: An example RPM package
License: GPL
URL: http://www.example.com
Source0: example.txt
BuildArch: noarch
@sawa2d2
sawa2d2 / how-to-upload-download-pdf-to-kindle-cloud.md
Last active December 8, 2022 19:24
How to upload/download pdf to Kindle Cloud
@sawa2d2
sawa2d2 / GAS(clasp)
Last active May 12, 2020 03:36
Dockerfiles
FROM node:14
RUN apt-get update \
&& npm install -g @google/clasp -g \
WORKDIR /workdir
VOLUME /workdir
SHELL ["/bin/bash", "-c"]