def enqueue(payload: bytes, logical_hash: str, priority: int) -> int:
"""
BEGIN IMMEDIATE;
INSERT INTO requests (...);
COMMIT;
return request_id
"""
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import fcntl | |
| import time | |
| start = time.monotonic() | |
| with open("/gpfs/lock/mylock", "w") as f: | |
| while True: | |
| try: | |
| fcntl.flock(f, fcntl.LOCK_EX | fcntl.LOCK_NB) | |
| break |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from dataclasses import fields, MISSING | |
| import logging | |
| logger = logging.getLogger(__name__) | |
| def from_dict(cls, data: dict): | |
| field_map = {field.name: field for field in fields(cls)} | |
| extra_keys = data.keys() - field_map.keys() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sqlite3 | |
| import socket | |
| from dataclasses import dataclass | |
| from typing import Optional, Callable | |
| # ---------------------------------------------------------------------- | |
| # Data model | |
| # ---------------------------------------------------------------------- |
Specify the USB device
lsblk
Mount the device
sudo mkdir -p /mnt/usb
sudo mount /dev/sdb1 /mnt/usb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { useState, useEffect } from 'react'; | |
| import axios from 'axios'; | |
| const HelloComponent = () => { | |
| const [helloMessage, setHelloMessage] = useState('Loading...'); | |
| useEffect(() => { | |
| const fetchData = async () => { | |
| try { | |
| const graphqlQuery = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
sudo yum install rpm-build python3-devel
pip install setuptools_rust
PyPi package の download
Note: This article is only for amazon.co.jp.
Upload your pdf via Send to Kindle (https://www.amazon.co.jp/sendtokindle) app.
Remove an item listed in personal documents.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM node:14 | |
| RUN apt-get update \ | |
| && npm install -g @google/clasp -g \ | |
| WORKDIR /workdir | |
| VOLUME /workdir | |
| SHELL ["/bin/bash", "-c"] |
NewerOlder